How to: Run a shell script with nohup command
Q. I'd like to run a command or shell script immune to hangups, with output to a non-tty or file. How do I use nohup command to run script called ~/utils/backup upload?
A. nohup is a Unix command that is used to run another command while suppressing the action of the HUP (hangup) signal, enabling the command to keep running after the user who issues the command has logged out. It is most often used to run commands in background as daemons. Output that would normally go to the terminal goes to a file called nohup.out if it has not already been redirected.
Run a script with nohup command
Type the command as follows to run a script called ~/utils/backup with 'upload' as argument to script:
$ nohup ~/utils/backup "upload" &
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Shell script error - bad interpreter messages and solution
- Howto run a shell script without changing file access permission
- Howto: Use mysql or run mysql queries from shell script
- Run shell script from web page
- Shell script to get the time difference
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: daemons, hangup, hangups, hup, nohup_command, shell_script, tty, unix_command



Recent Comments
Today ~ 1 Comment
Today ~ 2 Comments
Yesterday ~ 9 Comments
Yesterday ~ 32 Comments
07/04/2008 07:04 pm (2 days ago) ~ 1 Comment