Star

Created With

linkCron

Often it is usefull to trigger backups autmatically. For this we can specify a cron attribute to each location.

Available since version 0.18

.autorestic.yml
1locations:

2 my-location:

3 from: /data

4 to: my-backend

5 cron: '0 3 * * 0' # Every Sunday at 3:00

Here is a awesome website with some examples and an explorer

linkInstalling the cron

This has to be done only once, regadless of now many cros you have in your config file.

To actually enable cron jobs you need something to call autorestic cron on a timed shedule. Note that the shedule has nothing to do with the cron attribute in each location. My advise would be to trigger the command every 5min, but if you have a cronjob that runs only once a week, it's probably enough to shedule it once a day.

linkCrontab

Here is an example using crontab, but systemd would do too.

First, open your crontab in edit mode

1crontab -e

Then paste this at the bottom of the file and save it. Note that in this specific example the .autorestic.yml is located in /srv/. You need to modify that part of course to fit your config file.

1# This is required, as it otherwise cannot find restic as a command.

2PATH="/usr/local/bin:/usr/bin:/bin"

3

4# Example running every 5 minutes

5*/5 * * * * autorestic -c /srv/.autorestic.yml cron

Now you can add as many cron attributes as you wish ⏱

CronInstalling the cronCrontab

Home Quick Start Installation Configuration

Locationschevron_right
Backendchevron_right
CLIchevron_right

Examples

QA

Contributors