A wrapper script for Restic backup software that inits, creates, prunes and checks backups
runrestic is a simple Python wrapper script for the Restic backup software that initiates a backup, prunes any old backups according to a retention policy, and validates backups for consistency. The script supports specifying your settings in a declarative configuration file rather than having to put them all on the command-line, and handles common errors.
Here's an example config file:
repositories = [ "/tmp/restic-repo", "sftp:user@host:/srv/restic-repo", "s3:s3.amazonaws.com/bucket_name" ] [environment] RESTIC_PASSWORD = "CHANGEME" [backup] sources = [ "/home", "/var" ] [prune] keep-last = 3 keep-hourly = 5
To get up and running, first install Restic.
To install runrestic, run the following command to download and install it:
sudo pip3 install --upgrade runrestic
Note that your pip binary may have a different name than
pip3. Make sure
you're using Python 3, as runrestic does not support Python 2.
Once you have
runrestic ready, you should put a config file in on of the scanned locations, namely:
runrestic init # to initialize all the repos in `repositories` runrestic # without actions will do: runrestic backup prune check # or runrestic [action]
If you want to run runrestic automatically, say once a day, the you can configure a job runner to invoke it periodically.
If you're using cron, download the sample cron file. Then, from the directory where you downloaded it:
sudo mv runrestic /etc/cron.d/runrestic sudo chmod +x /etc/cron.d/runrestic
sudo mv runrestic.service runrestic.timer /etc/systemd/system/ sudo systemctl enable runrestic.timer sudo systemctl start runrestic.timer
Much of this project is copy and paste from borgmatic.
Release history Release notifications
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size runrestic-0.3.6-py3-none-any.whl (27.4 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size runrestic-0.3.6.tar.gz (24.5 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for runrestic-0.3.6-py3-none-any.whl