need help with this background wget process.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting need help with this background wget process.
# 1  
Old 04-12-2007
need help with this background wget process.

I run an online game, and every 10 seconds or so i need to "run" a file. In other words in needs to be executed. Its a PHP file.

The file updates vital things in my game, each time it does it its know as a "tick".

Here is the code i am using.

Code:
(wget http://www.planet-zorg.co.uk/10/myfile.php >wgetlog.log;sleep 10;./mainfile)& >/dev/null

the file is called mainfile.

It runs perfect, then i go to bed, wake up the next morning, and it has stopped. I have never had problems like this before. I asked my webhost, they tell me its a problem on my side and they arn't stopping them.

What can i do differently/what can the problem be to make it stop.

Is there any other way of doing this task in the background?


Mike
# 2  
Old 04-12-2007
Quick and dirty....

Put the command in a script that runs 5 times at 10 second intervals without going to the backgroup, then run the script every minute from cron worst case you go for a minute without updates.
# 3  
Old 04-13-2007
i tried that. i had a perl file which ran the tick file every 10 seconds in a loop, and was ran every minute by the crons. It sent the server load through the roof and the web host disabled it.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Make background process interact with fg process

Hi, I have written a menu driven shell script in which as per the choice, I run the another script on background. For eg: 1. get info 2)process info 3)modify info All the operations have different scripts which i schedule in background using &. However I wish to display the error... (0 Replies)
Discussion started by: ashima jain
0 Replies

2. Shell Programming and Scripting

How to put FTP process as a background process/job in perl?

Hi, I am using net::ftp for transferring files now i am trying in the same Linux server as a result ftp is very fast but if the server is other location (remote) then the file transferred will be time consuming. So i want try putting FTP part as a background process. I am unaware how to do... (5 Replies)
Discussion started by: vanitham
5 Replies

3. UNIX for Dummies Questions & Answers

Script to start background process and then kill process

What I need to learn is how to use a script that launches background processes, and then kills those processes as needed. The script successfully launches the script. But how do I check to see if the job exists before I kill it? I know my problem is mostly failure to understand parameter... (4 Replies)
Discussion started by: holocene
4 Replies

4. UNIX for Dummies Questions & Answers

Finding apache process id that is spawned by a wget

Hi, I have a situation where I am writing a programme that runs a series of long running PHP scripts that can take anything from 20 minutes to 10 hours to execute. I have a solution half implemented where I use via php exec(wget <location to command>) and get the process id back. This... (1 Reply)
Discussion started by: mrploddy
1 Replies

5. Shell Programming and Scripting

Keep process running (wget) and logout

well, i have only been learning about linux, unix and shells for a few days. For my online game to work, i need run a file each 10 seconds. Running that file will update mysql data, causing my online game to "tick". This adds resources and fights battles in game. I know that i need to use a... (3 Replies)
Discussion started by: mikey1090
3 Replies

6. Shell Programming and Scripting

background process

Hello, This has probably been answered in other forms, however I would like to confirm this statement before I use it in production. Will this syntax work for a background process? echo "nohup server_process1 >/dir1/nohup.server_process1 2>&1 &" | ksh Please advise. Thanks (1 Reply)
Discussion started by: jerardfjay
1 Replies

7. UNIX for Dummies Questions & Answers

background process

How, can I hide background process's output? (5 Replies)
Discussion started by: zylwyz
5 Replies

8. Shell Programming and Scripting

cause a process to be in background

Hi My script - main.sh, execute program1.sh in background and program2.sh in foreground . program1.sh holds the process ID of program2. program1.sh after a while needs to move the process of program2.sh to background. How? (0 Replies)
Discussion started by: avnerht
0 Replies

9. Programming

background process

I have made a shell that accept a command and parameters. It is working properly. I have tryed to implement background process in main(). But i dont know to implement them. Can anyone give me a lille example?? #include <stdlib.h> #include <stdio.h> #include <string.h> /* The following... (3 Replies)
Discussion started by: badshah
3 Replies

10. Shell Programming and Scripting

capture the process id when starting a background process

Hello all, How do I start a background process and save the process id to a file on my system. For example %wait 5 & will execute and print the process id. I can't figure out how to get it to a file. I've tried: > filename 0>filename 1>filename. Any assistance is most appreciated. Thanks, Jim... (10 Replies)
Discussion started by: jleavitt
10 Replies
Login or Register to Ask a Question