Notepad:crontab

From Amar
Revision as of 21:37, 3 December 2018 by Lax (talk | contribs) (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} $...")
(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