#!/bin/sh -xe # Init restic repository if neccessary restic snapshots &>/dev/null || restic init # Run backup job, using parameters from AWS_ACCESS_KEY_ID, # AWS_SECRET_ACCESS_KEY, RESTIC_PASSWORD, RESTIC_REPOSITORY restic backup $RESTIC_BACKUP_ARGS $RESTIC_BACKUP_FOLDERS # Cleanup old backups restic forget $RESTIC_FORGET_ARGS