Notepad:crontab

From Amar
Revision as of 20:09, 11 August 2022 by Lax (talk | contribs) (→‎Schedule crontab with locks)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Schedule crontab with locks

 if [ -d ${SOURCE} ]; then
 if [ -d ${DEST} ]; then
 (
  /usr/bin/flock -x -w 10 200 || exit 1
  /usr/bin/rsync -aq --delete-after ${SOURCE} ${DEST}.
 ) 200>/var/lock/.svnbackup.exclusivelock
 else
     echo "Dest dir $DEST doesn't exist"
 fi
 else
     echo "Source dir $SOURCE doesn't exist"
 fi