.
[rbackup.git] / .deb / opt / corvix / sbin / last_has_failed
bloba870dc2aed59db928f55d54b65fd35d992a09e2c
1 #!/bin/zsh
2 . /opt/corvix/etc/rbackup.conf
3 [[ -e $HOME/.rbackup.conf ]] && . $HOME/.rbackup.conf
5 LOGFILE=/opt/corvix/var/log/rbackup
6 RUNFILE=/opt/corvix/var/run/rbackup
8 _has_failed() {
9 test -e $RUNFILE
10 return $?
13 _log() {
14 echo $@
15 echo $@ >> $LOGFILE
18 _has_failed || exit 0
19 _log "Last run has failed. Recover last interval"
20 TASK=$(cat $RUNFILE)
21 name=$TASK
22 path=$TARGET/$SOURCE
23 host=$HOST
24 /usr/bin/ssh $host "rsync -avP --link-dest=../$name.1 $path/$name.1/. $path/$name.0/." 2>&1 1>>$LOGFILE
25 /bin/rm $RUNFILE