mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +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
12
readme.md
12
readme.md
|
|
@ -293,11 +293,21 @@ if ! [ -d "$TARGET_DIRECTORY" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f "$SOURCE_DIRECTORY/aio-lockfile" ]; then
|
||||
echo "Not continuing because aio-lockfile already exists."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
touch "$SOURCE_DIRECTORY/aio-lockfile"
|
||||
|
||||
if ! rsync --stats --archive --human-readable --delete "$SOURCE_DIRECTORY/" "$TARGET_DIRECTORY"; then
|
||||
echo "Failed to sync the backup repository to the target directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm "$SOURCE_DIRECTORY/aio-lockfile"
|
||||
rm "$TARGET_DIRECTORY/aio-lockfile"
|
||||
|
||||
umount "$DRIVE_MOUNTPOINT"
|
||||
|
||||
if docker ps --format "{{.Names}}" | grep "^nextcloud-aio-nextcloud$"; then
|
||||
|
|
@ -317,8 +327,6 @@ Afterwards apply the correct permissions with `sudo chown root:root /root/backup
|
|||
1. Add the following new line to the crontab if not already present: `0 20 * * 7 /root/backup-script.sh` which will run the script at 20:00 on Sundays each week.
|
||||
1. save and close the crontab (when using nano are the shortcuts for this `Ctrl + o` -> `Enter` and close the editor with `Ctrl + x`).
|
||||
|
||||
⚠️ **Attention:** Make sure that the execution of the script does not collide with the daily backups from AIO (if configured) since the target backup repository might get into an inconsistent state. (There is no check in place that checks this.)
|
||||
|
||||
### How to change the default location of Nextcloud's Datadir?
|
||||
You can configure the Nextcloud container to use a specific directory on your host as data directory. You can do so by adding the environmental variable `NEXTCLOUD_DATADIR` to the initial startup of the mastercontainer. Allowed values for that variable are strings that start with `/` and are not equal to `/`.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue