Last active
May 8, 2025 00:32
-
-
Save henri/a2ad48bf2dcb148d4ad1e46af9ef742d to your computer and use it in GitHub Desktop.
restic cheatsheet (specific to fish shell)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initilise restic backup repository + generate an initial key | |
restic init -r <repository-directory> | |
# configure enviroemnt varables (fish) / alter as needed | |
set -x RESTIC_REPOSITORY /path/to/repository | |
set -x RESTIC_PASSWORD_FILE /path/to/.restic_password | |
set -x RESTIC_PASSWORD my_AmZiNiNg_password | |
set -x RESTIC_EXCLUDE_FILE /path/to/.restic_exclude | |
# run a backup to the repository | |
restic backup <backup-source-file-or-directory> | |
# show snapshots | |
restic snapshots | |
# show top level items from latest snapshot | |
restic ls (restic snapshots --json | jq 'sort_by(.time) | .[-1]' | grep '"id": ' | tr -d , | tr -d \" | awk '{print $2}') | grep -E "^/" | |
# another approach is to tag a snapshot and then list it via that tag... | |
# prune snapshot data | |
restic prune | |
# check the repository | |
restic check | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment