BackupPC-users

[BackupPC-users] Detect when Backup_Link has finished

2013-12-10 17:30:16
Subject: [BackupPC-users] Detect when Backup_Link has finished
From: SimonUtter <backuppc-forum AT backupcentral DOT com>
To: backuppc-users AT lists.sourceforge DOT net
Date: Tue, 10 Dec 2013 14:28:52 -0800
>In some cases Backuppc_link runs after the backup has been done. Is there a 
>way to detect when it finishes, or to detect if it gets executed at all? I 
>>did a bit of testing using kill -0 and greping for backup_link pid. Some 
>times the linking just runs to fast for the script to get the pid. Do you guys 
>have >any ideas how to archive the latest backup after backuppc_link has been 
>executed? 

I do not know if this is the best way of doing this, but I just put in a sleep:

sleep 10
LINKPID=$(ps aux |grep "BackupPC_link" |grep ${1} |grep -v grep |awk {'print 
$2'})
if [ ${LINKPID} ]; then
while kill -0 ${LINKPID} ; do
        sleep 1
        echo ${LINKPID}
        LINKPID=$(ps aux |grep "BackupPC_link" |grep ${1} |grep -v grep |awk 
{'print $2'})
done
fi

Where $1 is the host getting backed up. Hope this helps somebody else

+----------------------------------------------------------------------
|This was sent by simon.utter AT gmail DOT com via Backup Central.
|Forward SPAM to abuse AT backupcentral DOT com.
+----------------------------------------------------------------------



------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

<Prev in Thread] Current Thread [Next in Thread>