Need method of killing shell script at 8:00am
Have a simple shell script which just runs rsync overnight. The script launches rsync, and loops until rsync returns zero or it's killed by ctrl-C.
Need a method to kill it at 8:00am every morning. Centos 5.4, rsync v3.0.7. ? |
Well, at will do it one time, cron will do it every day.
Hint: you'll need the PID of the running script and you get that with ps -e, piping that into grep or fgrep with the name of the script then then into awk to print the PID subsequently used with kill. |
Quote:
|
Wow, pgrep and pkill; never heard of 'em before but they sure do look like a useful alternative.
Learn sumptin new every other day or so... |
Could you post the script (a stripped down version)? If you are doing what I think you are doing, it will be easy for the script to exit itself just by checking the time in each loop iteration.
Cheers, Evo2. |
Quote:
|
All times are GMT -5. The time now is 06:45 PM. |