Use this image to sync your nextcloud to a local directory. This will be mounted in your container and used as input for restic. Restic creates a backup and upload it to your sftp host. All of it in a container based manner.
There are two modes.
./run_backup.sh
.env
file.
./run_backup.sh snapshots
./run_backup.sh init
These things are needed:
Place your public key at the sftp server and use the private key to log into it.
Currently, the private key should not have a password, it is not supported yet. This is not ideal, in further versions private key with passwords are supported and recommended to use.
https://github.com/realAP/backup.git
cd backup/docker
docker build . -t restic
Fill all variables in the .env
file, it is provided with example values.
In first place a repository has to be created on the remote (sftp).
./run_backup.sh init
this will initialize a repositoryJust run the script ./run_backup.sh
it will immediately sync the nextcloud and creates a backup, the status report will be sent via telegram.
This repeats every day at 1am (default), feel free to adjust the cron
variable in the run_backup.sh
Just work as you would do it with restic.
When cloned the repo there is an empty folder called restore
which is mounted into the container under /restore.
This folder can be used as target for your restored data.
Example: to get the latest snapshot from your data
./run_backup.sh restore latest --target /restore
The run_backup.sh
has a flag
"DEBUG"=0
which disables"DEBUG"=1
which enables debugging
The log
folder is mounted to /var/log
which enables to have access to different kinds of log files.
TBD
I have used https://duplicati.com/ which i can recommend. My problem is duplicati is not supported for my hardware anymore. This is the reason for this project.
I have nextcloud hosted by hetzner (https://www.hetzner.com/storage/storage-share/) and storagebox (https://www.hetzner.com/storage/storage-box/) a sftp hosted platform. The backup should work without hetzner it just needs a nextcloud server and sftp access.