-
I think supporting remote borg repos would be a good Idea, because then it would be possible to save the backups on another server/storage provider and with that the files would be also secured if the entire system crashes. Or the Disk of the backups dies. Or something else happens. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 23 replies
-
I fear this is out of scope for AIO. However you have multiple options to achieve this:
|
Beta Was this translation helpful? Give feedback.
-
Hi! We have tried to document step by step everything that needs to be done, from creating an account on BorgBase to configuring the crontab. We hope it will be useful, enjoy! BorgBase account creationRegister at https://www.borgbase.com and select a plan from those offered. However, all of them allow you to exceed the GB allowance by paying an additional fee. SSH key pair creationIn order to perform any operation on BorgBase remotely, you need to create an SSH key pair (which can also be used for SFTP operations). Follow the official guide: https://docs.borgbase.com/faq/ssh/ ⚠⚠⚠ Creating repos on BorgBase
Manual import/export testImportFollow the official guide: https://docs.borgbase.com/setup/import/#import-existing-repository. Two clarifications:
where ExportFollow the official guide: https://docs.borgbase.com/setup/import/#export-existing-repository. RClone installation and configurationThe following guide refers to Ubuntu servers; for other OS follow the official guide: https://rclone.org/install/
Leave the default for all options, apart from the following info:
Example: Test sync upload to BorgBase Follow the command specified in the official guide: https://docs.borgbase.com/setup/import/#using-rclone . In particular, the command must have the following format:
where Example:
Scheduled job creationThe following steps have been adapted from the following documentation: https://github.com/nextcloud/all-in-one#sync-the-backup-regularly-to-another-drive Create scripts
* /bin/bash
# Change all the variables below to suit your needs:
SOURCE_DIRECTORY="/mnt/backup/borg"
RCLONE_CONFIG="borgbase"
TARGET_DIRECTORY="repo"
########################################
# DO NOT modify any of the following! #
########################################
if [ "$EUID" -ne 0 ]; then
echo "run as root"
output 1
fi
if ! [ -d "$SOURCE_DIRECTORY" ]; then
echo "The root directory does not exist".
exit 1
fi
if [ -z "$(ls -A "$SOURCE_DIRECTORY/")" ]; then
echo "The source directory is empty, which is not allowed".
exit 1
fi
if [ -f "$SOURCE_DIRECTORY/lock.roster" ]; then
echo "Unable to execute the script as the backup archive is currently modified. Please try again later".
exit 1
fi
if [ -f "$SOURCE_DIRECTORY/aio-lockfile" ]; then
echo "Cannot continue because aio-lockfile already exists".
exit 1
fi
touch "$SOURCE_DIRECTORY/aio-lockfile".
if ! rclone sync --human-readable --exclude aio-lockfile "$SOURCE_DIRECTORY/" "$RCLONE_CONFIG:$TARGET_DIRECTORY"; then
echo "Failed to synchronise the backup repository with the target directory".
rm "$SOURCE_DIRECTORY/aio-lockfile"
exit 1
fi
rm "$SOURCE_DIRECTORY/aio-lockfile"
if docker ps --format "{{.Names}}" | grep "^nextcloud-aio-nextcloud$"; then
docker exec -en nextcloud-aio-nextcloud bash /notify.sh "Rclone backup successful!". "Synchronised the backup repository successfully".
else
echo "Synchronised the backup repository successfully".
fi where
Set crontab
CC @szaimen for your amazing work! If you think it would be useful, we can somehow make this guide more 'official'. |
Beta Was this translation helpful? Give feedback.
-
This is now implemented with v10.0.0 Beta. Testing and feedback is welcome! See https://github.com/nextcloud/all-in-one#how-to-switch-the-channel |
Beta Was this translation helpful? Give feedback.
This is now implemented with v10.0.0 Beta. Testing and feedback is welcome! See https://github.com/nextcloud/all-in-one#how-to-switch-the-channel