Script to do daily backups to a Samba share using BorgBackup.
Python 3.6+
BorgBackup 1.1.0+
OS supporting notify-send command
cifs-utils
Make sure that cifs-utils and borg (>= 1.1.0) is installed:
sudo apt-get install cifs-utils
sudo apt-get install borg
- Create new file
~/.smbcredentialswith the following content to have access to the Samba share
username=(username)
password=(password)
- Create mount point for NAS
sudo mkdir /media/nas
- Download this repository and put it into a directory of your choice (e.g.
~/scripts):
mkdir ~/scripts
cd ~/scripts
git clone https://github.com/ovalseven8/BackupScript
- Open
config.pyand fill the configs. - Make sure that all two scripts are executable!
- Create symbolic link to the backup script
sudo ln -s /path/to/backupScript /etc/cron.daily
- The script
checkBackupDate.pyis for checking if regular backups are created. If there have not been new backups for n days it shows a popup. AddcheckBackupDate.pyto autostart (depends on operating system).
Please be aware that if you change the location of the three files you should also change the symbolic link and maybe adjust autostart!