mirror of
https://github.com/ViViDboarder/docker-duplicity-cron.git
synced 2024-11-14 18:06:32 +00:00
26 lines
578 B
Bash
Executable File
26 lines
578 B
Bash
Executable File
#! /bin/bash
|
|
set -e
|
|
|
|
(
|
|
if ! flock -x -w $FLOCK_WAIT 200 ; then
|
|
echo 'ERROR: Could not obtain lock. Exiting.'
|
|
exit 1
|
|
fi
|
|
|
|
duplicity \
|
|
$1 \
|
|
--asynchronous-upload \
|
|
--log-file /root/duplicity.log \
|
|
--name $BACKUP_NAME \
|
|
$OPT_ARGUMENTS \
|
|
$PATH_TO_BACKUP \
|
|
$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
|