Run root shell script in background
Hi,
I need to run a shell script to remove some mailman archives (prune_arch).
However, that script requires root access, and runs for a few hours. My internet connection is a bit unstable though, so that I can't complete the process properly.
Is there any way to execute that script in the background, and write the output to a text file?
Best wishes,
Jan
-
hello you need create cronjabs ! run this command : crontab -e then crontab file should open and you need to add cronjabs codes. for example : 0 * * * * /usr/bin/myscript >> /root/myscript.log this cronjab run every hour and save output to /root/myscript.loh Good Luck.\ 0 -
Hey, You can run your script in a screen. If it is not installed in your server, you can install it via SSH : yum install screen
Once the installation is complete, you can check the screen man page for more details on setting up the screen.0 -
Hello :) Yes, "screen" is a useful utility if you want to run a command in the background: [url=http://linux.die.net/man/1/screen]screen(1) - Linux man page Thank you. 0 -
Thanks! Trying a cron job for now, since I'm familiar with those from the cPanel interface. 0
Please sign in to leave a comment.
Comments
4 comments