Posts

Showing posts with the label BorgBackup

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...

Install and Configure BorgBackup

Image
Install Borg Dependencies Debian / Ubuntu For Debian/Ubuntu: The FUSE library is available from the main package repository. Install the dependencies with development headers: sudo apt-get install python3 python3-dev python3-pip python3-virtualenv \ libacl1-dev libacl1 \ libssl-dev \ liblz4-dev libzstd-dev libxxhash-dev \ build-essential \ pkg-config python3-pkgconfig sudo apt-get install libfuse-dev fuse # needed for llfuse sudo apt-get install libfuse3-dev fuse3 # needed for pyfuse3 To be able send an email from the backup bash command, we have to install mailutils: apt install mailutils Look at  Borg Source  is still not  outdated ? Create a Virtual Environment Virtualenv can be used to build and install Borg without affecting the system Python or requiring root access. virtualenv --python=python3 borg-env source borg-env/bin/activate OR with virtualenvwrapper which python3 # Output: /usr/bin/python3 mkvirtualenv --python=/usr/bin/python3 borg-env Install Bo...