mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-02-24 13:57:01 +08:00
also save and restore daily backup time upon restore
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
b22c239998
commit
c29839f65f
1 changed files with 12 additions and 0 deletions
|
@ -230,6 +230,11 @@ if [ "$BORG_MODE" = restore ]; then
|
|||
ADDITIONAL_BACKUP_DIRECTORIES="$(cat /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/additional_backup_directories)"
|
||||
fi
|
||||
|
||||
# Save daily backup time
|
||||
if [ -f "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time" ]; then
|
||||
DAILY_BACKUPTIME="$(cat /nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time)"
|
||||
fi
|
||||
|
||||
# Restore everything except the configuration file
|
||||
if ! rsync --stats --archive --human-readable -vv --delete \
|
||||
--exclude "nextcloud_aio_mastercontainer/session/"** \
|
||||
|
@ -287,6 +292,13 @@ if [ "$BORG_MODE" = restore ]; then
|
|||
chmod 770 "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/additional_backup_directories"
|
||||
fi
|
||||
|
||||
# Reset the additional backup directories
|
||||
if [ -n "$DAILY_BACKUPTIME" ]; then
|
||||
echo "$DAILY_BACKUPTIME" > "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time"
|
||||
chown 33:0 "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time"
|
||||
chmod 770 "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/daily_backup_time"
|
||||
fi
|
||||
|
||||
umount /tmp/borg
|
||||
|
||||
# Inform user
|
||||
|
|
Loading…
Reference in a new issue