restic
restic is a fast, open-source backup program for the command line. It encrypts every backup with your password and stores only changed data, so repeated backups are small. It works with a Zata bucket as an S3 repository.
Before you start
- A bucket. See Create a bucket.
- An access key from the same region as the bucket. See Access keys.
- restic installed (see below).
Install restic
Check first whether restic is installed with restic version. To install it on Linux (x86-64):
Ubuntu’s apt install restic gives an old version (0.12). For Windows, macOS or ARM Linux, see the restic installation guide.
Connection settings
The /restic at the end of the repository is a folder inside your bucket, not a new bucket. restic does not use the AWS SDK, so it needs no checksum or signature settings for Zata.
Set up restic
Set the connection details
Replace my-bucket with your bucket name, and idr01 with bom01 if the bucket is in Mumbai.
These export lines last only for the current terminal.
Test it
List the snapshots, restore the latest one to a separate folder, and check the repository:
Open a few restored files to confirm they are complete.
Remove old snapshots
restic keeps every snapshot until you remove it. This keeps the last 7 daily and 4 weekly snapshots and deletes the data no longer needed:
Run it on a schedule
For scheduled backups (cron), put the settings in a script that only you can read:
Make it private and executable:
Then run crontab -e and add this line to run it every night at 02:00:
Troubleshooting
For other errors, see Signature errors and Endpoint and region.