Notepad:crontab: Difference between revisions

From Amar
Jump to navigationJump to search
Created page with "= 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} $..."
 
 
Line 1: Line 1:
= Schedule crontab with locks =
= Schedule crontab with locks =
 
<syntaxhighlight lang='bash' line>
  if [ -d ${SOURCE} ]; then
  if [ -d ${SOURCE} ]; then
  if [ -d ${DEST} ]; then
  if [ -d ${DEST} ]; then
Line 13: Line 13:
     echo "Source dir $SOURCE doesn't exist"
     echo "Source dir $SOURCE doesn't exist"
  fi
  fi
</syntaxhighlight>

Latest revision as of 20:09, 11 August 2022

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