Keep process running (wget) and logout


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Keep process running (wget) and logout
# 1  
Old 02-15-2006
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 bakground process, a wget commad.


Code:
#!/bin/bash

while true; do
wget my_url/tick.php
sleep 10
done

exit 0

that code runs the process in the ofreground. i want to exit Putty, logiut, and keep that process running for ever.

Can anyone hp me, or advise me how to do this?

Thanks, Mike
# 2  
Old 02-15-2006
i suppose you can run the script with the 'nuhup' and the '&'. this should keep it running after logout.
# 3  
Old 02-15-2006
Quote:
Originally Posted by ScatterBrain
i suppose you can run the script with the 'nuhup' and the '&'. this should keep it running after logout.
nohup

Cheers
ZB
# 4  
Old 02-15-2006
hahahha... yes. sorry about the typo. Smilie

Quote:
Originally Posted by zazzybob
nohup

Cheers
ZB
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Command to get exact tomcat process I am running ignoring other java process

Team, I have multiple batchjobs running in VM, if I do ps -ef |grep java or tomcat I am getting multiple process list. How do I get my exact tomcat process running and that is unique? via shell script? (4 Replies)
Discussion started by: Ghanshyam Ratho
4 Replies

2. UNIX for Advanced & Expert Users

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (6 Replies)
Discussion started by: naveeng
6 Replies

3. BSD

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (0 Replies)
Discussion started by: naveeng
0 Replies

4. UNIX for Advanced & Expert Users

How to keep program running after logout

Hello everyone. I am logged into a computer through ssh. I would like to run a program and have it keep running after I log out without screen (i forgot to run it). For example: ssh server user/comp~$ top & 12021 exit after that: ssh server user/comp~$ (something, maybe shell... (5 Replies)
Discussion started by: lepetal
5 Replies

5. 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

6. Shell Programming and Scripting

script to monitor process running on server and posting a mail if any process is dead

Hello all, I would be happy if any one could help me with a shell script that would determine all the processes running on a Unix server and post a mail if any of the process is not running or aborted. Thanks in advance Regards, pradeep kulkarni. :mad: (13 Replies)
Discussion started by: pradeepmacha
13 Replies

7. Shell Programming and Scripting

UniX Process not getting logout.

Hi, We have UNIX menu. when we exit the menu the processes are not getting log out. please suggest me how to log out the process after exit from the UNIX Menu. Regards, laknar. (3 Replies)
Discussion started by: laknar
3 Replies

8. UNIX for Dummies Questions & Answers

Keep process running on logout

Hey All, I'm logging in via an SSH shell. I'm wondering if there's a way to execute a command and it not die when I close my terminal window (or rather, logout of the SSH shell). Thanks, Nathan (3 Replies)
Discussion started by: NathanWarden
3 Replies

9. Programming

Running app after logout and monitoring

Hello! I just programmed a very simple app, it's function is to report every minute the state of the memory and cpu and put it to and xml. All this stuff is working ok since I'm logged in into the machine, but i want it to run as a service, how can I do that?? P.S: Any one knows how can I... (1 Reply)
Discussion started by: ncatdesigner
1 Replies

10. Shell Programming and Scripting

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. (wget... (2 Replies)
Discussion started by: mikey1090
2 Replies
Login or Register to Ask a Question