mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-21 23:16:59 +00:00
Merge pull request #795 from nextcloud/enh/723/external-backup-locking
allow to lock the backup archive for external scripts
This commit is contained in:
commit
effeb44690
2 changed files with 17 additions and 2 deletions
|
|
@ -37,6 +37,13 @@ if [ "$BORG_MODE" != backup ] && [ "$BORG_MODE" != test ] && ! [ -f "$BORG_BACKU
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Do not continue if this file exists (needed for simple external blocking)
|
||||
if [ -f "$BORG_BACKUP_DIRECTORY/aio-lockfile" ]; then
|
||||
echo "Not continuing because aio-lockfile exists - it seems like a script is externally running which is locking the backup archive."
|
||||
echo "If this should not be the case, you can fix this by deleting the 'aio-lockfile' file from the backup archive directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create lockfile
|
||||
if [ "$BORG_MODE" = backup ] || [ "$BORG_MODE" = restore ]; then
|
||||
touch "/nextcloud_aio_volumes/nextcloud_aio_database_dump/backup-is-running"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue