Automatically backing up snapshots like cron

I have a few VPS with 500MB total data each.
I want to use restic to backup all VPS daily at 12:00 (full system image/snapshots) and upload them to my aws or azure blob storage in encrypted format (with a password that I choose). I want to keep backups upto 30 days old on my cloud storage and I want to be able to restore from any of these snapshots at any time, and even download them on my computer from AWS or Azure directly, and decrypt and view files on my system.

Is what I am saying possible at all?

Yep!

Set up a cron job to run at the time(s) you want: restic backup to perform a backup, then restic forget --keep-within 30d --prune to lose snapshots older than 30 days.

When you want to restore, that’s what restic restore is for.

I think your command is not for whole system snapshot, is it?

And what to do if I want to backup 2 folders like /root, /etc. What is the command?
Sorry I am new to all this.

Welcome to the forum and restic itself :slight_smile:
In general a good rule of thumb is to check if a program has a documentation, and if so you should make great use of the documentation. Restic has one and you can find it here: https://restic.readthedocs.io/en/latest/

All general questions should be answered there. If not feel free to come back to the forum and well try to help you out!

1 Like

i have done it but i could not find any command for whole system snapshot. am i missing something here?

There’s a tutorial of something pretty close to what you want: https://restic.readthedocs.io/en/latest/080_examples.html#full-backup-without-root

1 Like

What about storing snapshots/backups on S3 etc. in encrypted format like .aes perhaps. Is this possible?

Snapshots are always encrypted. Just follow the docs: https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#amazon-s3 - it’s all in the docs!

2 Likes

Regarding to backup retention management, I created a tool for managing the automatic purge of Restic backups based on time and retention policies. Maybe you can make a good use of it…

If you want to backup 2 different folders, you could launch two containers with my utility each pointing to one folder and use them with different retention policies.