Automated backups with environment variable

I want to automate backups with environment variables RESTIC_REPOSITORY and RESTIC_REPOSITORY_FILE according to docu.
This means I added these entries in ~/.bashrc:

# Restic variables

Can you please advise which command (syntax) must be used for creating a backup of /home?


1 Like

With those environment variables set (and assuming you already ran restic init?), the syntax should be as simple as:

restic backup /home

the docs have more complex examples you can follow along with if you want. You just need to omit the repository location (-r /srv/restic-repo in the docs) as you’ve already specified it via an environment variable.


You can also use RESTIC_REPOSITORY=/path/to/your/restic/backup/repo directly instead of making restic read the repo path from a file. Or specify it via -r like @shd2h said.

The files to backup must be specified via command line.

1 Like