docker-duplicity-cron/backup.sh

26 lines
578 B
Bash
Raw Normal View History

2017-03-19 00:11:03 +00:00
#! /bin/bash
set -e
(
if ! flock -x -w $FLOCK_WAIT 200 ; then
echo 'ERROR: Could not obtain lock. Exiting.'
exit 1
fi
2017-03-19 00:11:03 +00:00
duplicity \
$1 \
--asynchronous-upload \
2017-03-19 00:11:03 +00:00
--log-file /root/duplicity.log \
2017-06-29 06:28:48 +00:00
--name $BACKUP_NAME \
$OPT_ARGUMENTS \
$PATH_TO_BACKUP \
2017-03-19 00:11:03 +00:00
$BACKUP_DEST
if [ -n "$CLEANUP_COMMAND" ]; then
duplicity $CLEANUP_COMMAND \
--log-file /root/duplicity.log \
--name $BACKUP_NAME \
$BACKUP_DEST
fi
) 200>/var/lock/duplicity/.duplicity.lock