I agree with all that anup123 says. The worst is when backups does not finish untill morning and then as traffic climbs, server eventually gets to a very high load and craches. I notice that there are 3 rsync processes running simultaneously.
Actually most of the time incremental backup finishes in 2-3 hours. only some days it goes for more than 8 hours. That is strange.
I was looking for a solution to stop backup at 7 in the morning if it is still running. I am not very good at shell scripting but have this gathered up to now:
processes that need to be killed:
root 17592 0.0 0.0 6720 544 ? SN 01:00 0:00 /usr/bin/perl /scripts/cpbackup
and all occurences of rsync
here are some possible ways to make a cron job at 7 AM, not sure which to use. I would appreciate help from someone more proficient with this:
Code:
kill `ps -ef | grep process | awk '{print $2}'`
or
kill -9 `ps -aef | grep processes | grep -v grep | awk '{print $2|}'`
or
'ps -aef | grep <whatever> | awk '{print $1} | xargs kill -9'
or
ps -ef | grep [p]rossess | xargs kill -9
or
for i in `ps -ef |grep <process> |grep -v grep|awk '{print $2}'`
do
kill $i
done
Edit: I just thought that the long running rsync may occur when a daily backup is done and immediately after it fires the weekly backup?