Automate borg backups with Cron
Install dependencies To be able send an email from the backup bash command, we have to install mailutils: apt install mailutils Create borg_backup.sh First, create a script which will execute the backups. This could look like the following script and be under /home/server_backup/scripts/borg_backup.sh . #!/usr/bin/env bash ################################################ #### borg create and borg prune #### #### PLEASE CHECK BACKUP DIRECTORIES #### ################################################ ## ## Set environment variables ## ## if you don't use the standard SSH key, ## you have to specify the path to the key like this export BORG_RSH= "ssh -i /root/.ssh/id_rsa_borg" ## You can save your borg passphrase in an environment ## variable, so you don't need to type it in when using borg # export BORG_PASSPHRASE="top_secret_passphrase" # ACTIVATE VENV source /usr/ local /venvs/borg-env/bin/activate ## ## Set some var...