Skip to content

Commit 529f0b4

Browse files
committed
Fixed a few issues
1 parent 5495a63 commit 529f0b4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

backup-service/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ ADD . /opt/backups
9191
VOLUME ["/data"]
9292

9393
# Define entrypoint script.
94-
ENTRYPOINT ["./entrypoint"]
94+
ENTRYPOINT ["./script/docker-entrypoint.sh"]
9595

9696
# Define default command.
9797
CMD ["/sbin/my_init"]

backup-service/entrypoint renamed to backup-service/script/docker-entrypoint.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ case "${BACKUP_COMMAND}" in
1717
# Extract the backup task argument and execute it
1818
shift
1919
BACKUP_TASK=$1
20-
shift
2120
command="script/trigger-backup.sh ${BACKUP_TASK}"
2221
;;
2322
"schedule"|"scheduler"|"cron" )
24-
shift
2523
# Write the crontab entries from the whenever schedule
2624
script/create-schedule.sh
2725
# Call the phusion baseimage docker initialization script

backup-service/script/trigger-backup.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ if [ "${BACKUP_TASK}" == "" ]; then
1313
fi
1414

1515
echo "Triggering backup task ${BACKUP_TASK}."
16-
exec backup perform --config-file="${BACKUP_CONFIG_DIR}/config.rb" --root-path="${BACKUP_DATA_DIR}" --trigger ${BACKUP_TASK}
16+
mkdir -p "${BACKUP_DATA_DIR}/.tmp"
17+
exec /usr/bin/flock --exclusive --wait 300 "${BACKUP_DATA_DIR}/.tmp/trigger-backup-${BACKUP_TASK}.lockfile" \
18+
backup perform --config-file="${BACKUP_CONFIG_DIR}/config.rb" --root-path="${BACKUP_DATA_DIR}" --trigger ${BACKUP_TASK}

0 commit comments

Comments
 (0)