This article will take about 1 minute to read.
Listing all snapshots
restic -r s3:s3.amazonaws.com/my-bucket snapshots
Getting the list of snapshot names
./do-list-snapshots.sh |\
grep ':' |\
rev |\
cut -d' ' -f 1 |\
rev |\
sort |\
uniq
Restoring a snapshot
#!/bin/bash
if [ $# -ne 2 ]; then
echo FAIL: requires 2 arguments
echo - snapshot name
echo - destination path
exit 1
fi
restic \
-r s3:s3.amazonaws.com/my-bucket \
restore latest \
--path "$1" \
--target "$2"