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.
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?
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.
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.
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)
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)
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)
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)
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)
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)
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)
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)
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)