### List snapshots with restic snapshots Source: https://restic.net/blog/2016-08-22/removing-snapshots Lists all snapshots in the repository. The example shows about 235 snapshots from daily backups, with the first snapshot ID 6e001a58 used in the forget example. ```bash $ restic snapshots ID Date Host Directory ---------------------------------------------------------------------- 6e001a58 2016-01-01 04:00:00 mopped /home/fd0/tmp/data 62a86121 2016-01-02 04:00:00 mopped /home/fd0/tmp/data ee891602 2016-01-03 04:00:00 mopped /home/fd0/tmp/data [...] d0267dbb 2016-08-20 05:00:00 mopped /home/fd0/tmp/data 6261b96f 2016-08-21 05:00:00 mopped /home/fd0/tmp/data 5116cfdc 2016-08-22 05:00:00 mopped /home/fd0/tmp/data ``` -------------------------------- ### Run local documentation server with mkdocs serve Source: https://restic.net/blog/2016-02-24/Documentation Run this command from the repository root to start a local MkDocs server. It builds the documentation, cleans the site directory, and serves it at http://127.0.0.1:8000. The server watches for changes and detects them automatically. Add the `--livereload` parameter to make the browser refresh automatically after a file change. ```bash $ mkdocs serve INFO - Building documentation... INFO - Cleaning site directory [I 160224 21:04:49 server:271] Serving on http://127.0.0.1:8000 [I 160224 21:04:49 handlers:58] Start watching changes [I 160224 21:04:49 handlers:60] Start detecting changes ``` -------------------------------- ### Use restic with rclone REST server Source: https://restic.net/blog/2018-04-01/rclone-backend Initializes a restic repository and backs up the home directory using the REST server started with rclone. Requires restic version 0.8.2 or later. ```bash $ restic --repository rest:http://foo:s3kr1t@localhost:8889 init [...] $ restic --repository rest:http://foo:s3kr1t@localhost:8889 backup $HOME ``` -------------------------------- ### Start rclone REST server for restic Source: https://restic.net/blog/2018-04-01/rclone-backend Starts rclone in server mode to serve restic's REST protocol on localhost:8889 with the given credentials and remote path. Requires rclone version 1.40 or later. ```bash $ rclone serve restic --addr localhost:8889 --user foo --pass s3kr1t remote:bucket/path ``` -------------------------------- ### List snapshots with restic snapshots Source: https://restic.net/blog/2016-08-22/removing-snapshots Shows the output of the restic snapshots command, listing snapshot IDs, dates, hosts, and directories. This example is used to illustrate how forget filters snapshots. ```bash $ restic snapshots ID Date Host Directory ---------------------------------------------------------------------- dbd30e0e 2016-08-22 03:00:00 mopped /home/fd0/tmp/data 45e789ca 2016-08-22 03:53:08 mopped /home/fd0/tmp/data c0411b71 2016-08-22 04:00:00 mopped /home/fd0/tmp/data 1f782cb4 2016-08-22 04:13:23 mopped /home/fd0/tmp/data 62df5e1e 2016-08-22 04:18:23 mopped /home/fd0/tmp/data 0b9fe168 2016-08-22 05:23:00 mopped /home/fd0/tmp/data 0fe0dcfe 2016-08-22 18:08:17 mopped /home/fd0/tmp/data d221a465 2016-08-22 19:24:00 mopped /home/fd0/tmp/data 98fb9f00 2016-08-22 19:53:23 mopped /home/fd0/tmp/data ``` -------------------------------- ### Create a signed git tag with --annotate and --sign Source: https://restic.net/blog/2015-09-16/verifying-code-archive-integrity Use `git tag --annotate --sign` to create a signed tag for the current commit. The example signs the current commit as version v0.1.0 with the message "v0.1.0". ```bash $ git tag --annotate --sign --message "v0.1.0" v0.1.0 ``` -------------------------------- ### Install Restic on CentOS/RedHat via yum-config-manager Source: https://restic.net/blog/2018-05-21/restic-0.9.0-released For CentOS/RedHat systems, manually add the Restic COPR repository before installing. This replaces the official 'yum copr enable copart/restic' command, which may fail. After adding the repo, proceed with the standard installation command. ```bash yum-config-manager --add-repo https://copr.fedorainfracloud.org/coprs/copart/restic/repo/epel-7/copart-restic-epel-7.repo ``` ```bash yum install restic ``` -------------------------------- ### Install restic via yum copr Source: https://restic.net/blog/2018-05-21/restic-0.9.0-released Commands to install the restic package from the Copr repository on Fedora using yum. The output shows a prompt to confirm enabling the repository, followed by an error indicating the repository is not found (HTTPS 404). ```bash yum install yum-plugin-copr yum copr enable copart/restic Do you want to continue? [y/N]: y ``` -------------------------------- ### Create test data with mkdir and dd Source: https://restic.net/blog/2015-09-12/restic-foundation1-cdc Creates a test directory and fills a file with 100MiB of random data using dd. The output shows the number of records and the copy speed. ```bash $ mkdir testdata $ dd if=/dev/urandom of=testdata/file.raw bs=1M count=100 100+0 records in 100+0 records out 104857600 bytes (105 MB) copied, 5.76985 s, 18.2 MB/s ``` -------------------------------- ### Backup after creating a combined file Source: https://restic.net/blog/2015-09-12/restic-foundation1-cdc Backs up the directory again and checks the repository size. The repository grows by about 10MiB because a few new chunks were created when creating file3.raw. ```bash $ restic backup testdata using parent snapshot ab8e0047 scan [/home/fd0/tmp/testdata] scanned 1 directories, 3 files in 0:00 [0:03] 100.00% 127.638 MiB/s 400.000 MiB / 400.000 MiB 2 / 4 ... ETA 0:00 duration: 0:03, 123.73MiB/s snapshot a8897ae3 saved $ du -sh $RESTIC_REPOSITORY 111M /tmp/restic-test-repository ``` -------------------------------- ### Initialize a restic repository with restic init Source: https://restic.net/blog/2015-09-12/restic-foundation1-cdc Initializes a new restic repository at the location specified by RESTIC_REPOSITORY. The output includes a warning that losing the password means the data is irrecoverably lost. ```bash $ restic init created restic backend 2b310bf378 at /tmp/restic-test-repository Please note that knowledge of your password is required to access the repository. Losing your password means that your data is irrecoverably lost. ``` -------------------------------- ### Create a combined file with shell commands Source: https://restic.net/blog/2015-09-12/restic-foundation1-cdc Creates a new file that is a combination of the original 100MiB file with added strings, resulting in about 400MiB in the testdata directory. ```bash $ (echo foo; cat testdata/file.raw; echo bar; cat testdata/file.raw; echo baz) \ > testdata/file3.raw $ du -sh testdata 401M testdata ``` -------------------------------- ### Initialize restic repository with rclone backend Source: https://restic.net/blog/2018-04-01/rclone-backend Initializes a new restic repository in the specified path within the rclone remote. The output shows the created repository ID. ```bash $ restic --repo rclone:b2prod:yggdrasil/prod-serverA init created restic repository 7905a088a0 at rclone:b2prod:yggdrasil/prod-serverA [...] ``` -------------------------------- ### Check repository size after first backup Source: https://restic.net/blog/2015-09-12/restic-foundation1-cdc Checks the repository size after the first backup. The repository is roughly the same size as the data backed up (101M). ```bash $ du -sh $RESTIC_REPOSITORY 101M /tmp/restic-test-repository ``` -------------------------------- ### Travis CI build matrix with per-OS cache configuration Source: https://restic.net/blog/2018-09-02/travis-build-cache YAML configuration for Travis CI build matrix that specifies cache directories for each OS and Go version. Linux uses $HOME/.cache/go-build, while OS X uses $HOME/Library/Caches/go-build. ```yaml matrix: include: - os: linux go: "1.9.x" cache: directories: - $HOME/.cache/go-build - $HOME/gopath/pkg/mod - os: linux go: "1.10.x" cache: directories: - $HOME/.cache/go-build - $HOME/gopath/pkg/mod - os: linux go: "1.11.x" sudo: true cache: directories: - $HOME/.cache/go-build - $HOME/gopath/pkg/mod - os: osx go: "1.11.x" cache: directories: - $HOME/Library/Caches/go-build - $HOME/gopath/pkg/mod ``` -------------------------------- ### Verify restic repository files with rclone Source: https://restic.net/blog/2018-04-01/rclone-backend Verifies that the restic repository was created by listing the bucket again, showing the new config and key files. ```bash $ rclone ls b2prod:yggdrasil 155 prod-serverA/config 448 prod-serverA/keys/598a405c64c1f878a7eeb6a4691747defdc4d9d4caaa01ae2c3caa02878d3d74 ``` -------------------------------- ### Compare SHA-256 hashes of recreated and downloaded archives Source: https://restic.net/blog/2015-09-16/verifying-code-archive-integrity Verify that the recreated tar.gz file matches the automatically generated one by comparing SHA-256 hashes. The output shows identical hashes for both files. ```bash $ sha256sum restic-0.1.0.tar.gz df7842cb690a56ce5371013a958d9f324072429897511d4bbfc092d76303f198 restic-0.1.0.tar.gz $ curl -s -L https://github.com/restic/restic/archive/v0.1.0.tar.gz | sha256sum df7842cb690a56ce5371013a958d9f324072429897511d4bbfc092d76303f198 - ``` -------------------------------- ### Backup after copying a file Source: https://restic.net/blog/2015-09-12/restic-foundation1-cdc Copies the file, checks the testdata size, backs up again, and checks the repository size. Restic recognizes that all data is already known, so the repository size does not grow despite the directory now containing 200MiB. ```bash $ cp testdata/file.raw testdata/file2.raw $ du -sh testdata 200M testdata $ restic backup testdata using parent snapshot 0b870550 scan [/home/fd0/tmp/testdata] scanned 1 directories, 2 files in 0:00 [0:01] 100.00% 163.617 MiB/s 200.000 MiB / 200.000 MiB 1 / 3 ... ETA 0:00 duration: 0:01, 129.06MiB/s snapshot ab8e0047 saved $ du -sh $RESTIC_REPOSITORY 101M /tmp/restic-test-repository ``` -------------------------------- ### Run restic backup a second time Source: https://restic.net/blog/2015-09-12/restic-foundation1-cdc Runs the backup command a second time. Restic uses the parent snapshot and finishes in less than a second because the data is already known. ```bash $ restic backup testdata using parent snapshot 7452bd17 scan [/home/fd0/tmp/testdata] scanned 1 directories, 1 files in 0:00 [0:00] 100.00% 0B/s 100.000 MiB / 100.000 MiB 0 / 2 items ... ETA 0:00 duration: 0:00, 20478.98MiB/s snapshot 0b870550 saved ``` -------------------------------- ### Verify the GPG key fingerprint with gpg --fingerprint Source: https://restic.net/blog/2015-09-16/verifying-code-archive-integrity Display the fingerprint of the imported key to verify its authenticity. The output shows the key details and fingerprint. ```bash $ gpg --fingerprint D3F7A907 pub rsa4096/D3F7A907 2014-11-01 Key fingerprint = CF8F 18F2 8445 7597 3F79 D4E1 91A6 868B D3F7 A907 uid [ultimate] Alexander Neumann sub rsa4096/4043FDF1 2014-11-01 ``` -------------------------------- ### restic forget --help output Source: https://restic.net/blog/2016-08-22/removing-snapshots Shows the help output for the forget command, listing retention options such as --keep-last, --keep-hourly, --keep-daily, --keep-weekly, --keep-monthly, --keep-yearly, --hostname, and --dry-run. ```bash $ restic forget --help [...] Help Options: -h, --help Show this help message [forget command options] -l, --keep-last= keep the last n snapshots -H, --keep-hourly= keep the last n hourly snapshots -d, --keep-daily= keep the last n daily snapshots -w, --keep-weekly= keep the last n weekly snapshots -m, --keep-monthly= keep the last n monthly snapshots -y, --keep-yearly= keep the last n yearly snapshots --hostname= only forget snapshots for the given hostname -n, --dry-run do not delete anything, just print what would be done ``` -------------------------------- ### Verify the release archive signature with gpg --verify Source: https://restic.net/blog/2015-09-16/verifying-code-archive-integrity Verify the detached signature on the downloaded release archive. The output shows the signature details and confirms a good signature. ```bash $ gpg --verify restic-0.1.0.tar.gz.asc gpg: assuming signed data in 'restic-0.1.0.tar.gz' gpg: Signature made Mi 16 Sep 2015 23:33:11 CEST using RSA key ID D3F7A907 gpg: Good signature from "Alexander Neumann " ``` -------------------------------- ### Backup testdata with restic backup Source: https://restic.net/blog/2015-09-12/restic-foundation1-cdc Backs up the testdata directory with restic. The output shows the scan, progress, duration, and the saved snapshot ID. ```bash $ restic backup testdata scan [/home/fd0/tmp/testdata] scanned 1 directories, 1 files in 0:00 [0:02] 100.00% 41.457 MiB/s 100.000 MiB / 100.000 MiB 0 / 2 it...ETA 0:00 duration: 0:02, 44.21MiB/s snapshot 7452bd17 saved ``` -------------------------------- ### AppVeyor cache configuration for Go build cache Source: https://restic.net/blog/2018-09-02/travis-build-cache YAML configuration for AppVeyor to cache the Go build cache directory on Windows. This is used in appveyor.yml. ```yaml cache: - '%LocalAppData%\go-build' ``` -------------------------------- ### Import the GPG signing key with gpg --recv-key Source: https://restic.net/blog/2015-09-16/verifying-code-archive-integrity Import the public key used for signing restic releases from a public key server. The key ID is D3F7A907. ```bash $ gpg --recv-key D3F7A907 ``` -------------------------------- ### Check repository size with du -sh Source: https://restic.net/blog/2015-09-12/restic-foundation1-cdc Checks the size of the repository after initialization. At this point nothing has been saved, so the repository is rather small (8.0K). ```bash $ du -sh $RESTIC_REPOSITORY 8.0K /tmp/restic-test-repository ``` -------------------------------- ### restic self-update with explicit path Source: https://restic.net/blog/2019-01-06/restic-0.9.4-released Alternative way to upgrade restic by specifying a direct path for the new binary, e.g., /usr/local/bin/restic. ```bash $ restic self-update --output /usr/local/bin/restic ``` -------------------------------- ### restic forget --dry-run with retention policy Source: https://restic.net/blog/2016-08-22/removing-snapshots Runs forget with --dry-run to preview which snapshots would be kept and removed under a policy of keeping 7 daily, 8 weekly, and 24 monthly snapshots. The output shows 21 snapshots kept and 213 removed. ```bash $ restic forget --dry-run --keep-daily 7 --keep-weekly 8 --keep-monthly 24 keep 21 snapshots: ID Date Host Directory ---------------------------------------------------------------------- 5116cfdc 2016-08-22 05:00:00 mopped /home/fd0/tmp/data 6261b96f 2016-08-21 05:00:00 mopped /home/fd0/tmp/data d0267dbb 2016-08-20 05:00:00 mopped /home/fd0/tmp/data e7e18480 2016-08-19 05:00:00 mopped /home/fd0/tmp/data b2fd97b2 2016-08-18 05:00:00 mopped /home/fd0/tmp/data 9743b40d 2016-08-17 05:00:00 mopped /home/fd0/tmp/data 3ef3007b 2016-08-16 05:00:00 mopped /home/fd0/tmp/data 3c3f7ad4 2016-08-15 05:00:00 mopped /home/fd0/tmp/data b471d6eb 2016-08-14 05:00:00 mopped /home/fd0/tmp/data 0f2f3b55 2016-08-07 05:00:00 mopped /home/fd0/tmp/data 47fe0a0f 2016-07-31 05:00:00 mopped /home/fd0/tmp/data 0d7b57eb 2016-07-24 05:00:00 mopped /home/fd0/tmp/data c94ee5ac 2016-07-17 05:00:00 mopped /home/fd0/tmp/data fc48f6b6 2016-07-10 05:00:00 mopped /home/fd0/tmp/data 5e9fe6d2 2016-07-03 05:00:00 mopped /home/fd0/tmp/data 774c5721 2016-06-26 05:00:00 mopped /home/fd0/tmp/data d9b9c5b2 2016-05-31 05:00:00 mopped /home/fd0/tmp/data 446e6030 2016-04-30 05:00:00 mopped /home/fd0/tmp/data 6f86935a 2016-03-31 05:00:00 mopped /home/fd0/tmp/data 1722682f 2016-02-29 04:00:00 mopped /home/fd0/tmp/data dd2bbbf9 2016-01-31 04:00:00 mopped /home/fd0/tmp/data remove 213 snapshots: ID Date Host Directory ---------------------------------------------------------------------- f3da855f 2016-08-13 05:00:00 mopped /home/fd0/tmp/data 347274f4 2016-08-12 05:00:00 mopped /home/fd0/tmp/data f314dd1f 2016-08-11 05:00:00 mopped /home/fd0/tmp/data [...] a07ffe20 2016-01-04 04:00:00 mopped /home/fd0/tmp/data ee891602 2016-01-03 04:00:00 mopped /home/fd0/tmp/data 62a86121 2016-01-02 04:00:00 mopped /home/fd0/tmp/data ``` -------------------------------- ### git archive zip for restic source Source: https://restic.net/blog/2019-01-06/restic-0.9.4-released Command to create a zip format archive with git archive, as a guess for how GitHub might generate the zip source archive. ```bash $ git archive --format=zip --prefix=restic-0.1.0/ v0.1.0 > restic-0.1.0.zip ``` -------------------------------- ### Travis CI cache configuration for Go build cache Source: https://restic.net/blog/2018-09-02/travis-build-cache YAML configuration for Travis CI to cache the Go build cache and module cache directories. This is used in .travis.yml to speed up builds by preserving the cache between runs. ```yaml cache: directories: - $HOME/.cache/go-build - $HOME/gopath/pkg/mod ``` -------------------------------- ### Recreate release tar.gz with git archive and gzip Source: https://restic.net/blog/2015-09-16/verifying-code-archive-integrity Recreate the GitHub-generated tar.gz file for a release using `git archive` and `gzip -n`. The command creates restic-0.1.0.tar.gz from the v0.1.0 tag. ```bash $ git archive --format=tar --prefix=restic-0.1.0/ v0.1.0 | gzip -n > restic-0.1.0.tar.gz ``` -------------------------------- ### List snapshots after applying expire policy Source: https://restic.net/blog/2016-08-22/removing-snapshots Shows the output of the `restic snapshots` command after an expire policy has been applied, resulting in a reduced list of snapshots. ```text $ restic snapshots ID Date Host Directory ---------------------------------------------------------------------- dd2bbbf9 2016-01-31 04:00:00 mopped /home/fd0/tmp/data 1722682f 2016-02-29 04:00:00 mopped /home/fd0/tmp/data 6f86935a 2016-03-31 05:00:00 mopped /home/fd0/tmp/data 446e6030 2016-04-30 05:00:00 mopped /home/fd0/tmp/data d9b9c5b2 2016-05-31 05:00:00 mopped /home/fd0/tmp/data 774c5721 2016-06-26 05:00:00 mopped /home/fd0/tmp/data 5e9fe6d2 2016-07-03 05:00:00 mopped /home/fd0/tmp/data fc48f6b6 2016-07-10 05:00:00 mopped /home/fd0/tmp/data c94ee5ac 2016-07-17 05:00:00 mopped /home/fd0/tmp/data 0d7b57eb 2016-07-24 05:00:00 mopped /home/fd0/tmp/data 47fe0a0f 2016-07-31 05:00:00 mopped /home/fd0/tmp/data 0f2f3b55 2016-08-07 05:00:00 mopped /home/fd0/tmp/data b471d6eb 2016-08-14 05:00:00 mopped /home/fd0/tmp/data 3c3f7ad4 2016-08-15 05:00:00 mopped /home/fd0/tmp/data 3ef3007b 2016-08-16 05:00:00 mopped /home/fd0/tmp/data 9743b40d 2016-08-17 05:00:00 mopped /home/fd0/tmp/data b2fd97b2 2016-08-18 05:00:00 mopped /home/fd0/tmp/data e7e18480 2016-08-19 05:00:00 mopped /home/fd0/tmp/data d0267dbb 2016-08-20 05:00:00 mopped /home/fd0/tmp/data 6261b96f 2016-08-21 05:00:00 mopped /home/fd0/tmp/data 5116cfdc 2016-08-22 05:00:00 mopped /home/fd0/tmp/data ``` -------------------------------- ### Set RESTIC_REPOSITORY and RESTIC_PASSWORD environment variables Source: https://restic.net/blog/2016-08-22/removing-snapshots Sets the repository location and password in environment variables so that restic commands can be run directly without specifying them each time. ```bash $ export RESTIC_REPOSITORY=/tmp RESTIC_PASSWORD=geheim ``` -------------------------------- ### Verify a signed git tag with git tag --verify Source: https://restic.net/blog/2015-09-16/verifying-code-archive-integrity Use `git tag --verify` to check the signature of a signed tag. The output shows the tag object details and the GPG signature verification result. ```bash $ git tag --verify v0.1.0 object 16e87d72087a2550b24b413ffc46e9d1fa50dd68 type commit tag v0.1.0 tagger Alexander Neumann 1440188457 +0200 v0.1.0 gpg: Signature made Fr 21 Aug 2015 22:20:57 CEST using RSA key ID D3F7A907 gpg: Good signature from "Alexander Neumann " ``` -------------------------------- ### restic S3 command with /restic path Source: https://restic.net/blog/2017-11-25/upcoming-changes-to-s3 Correct command to access an existing repository by appending the path `/restic` to the S3 location. This is required after the change to the default path behavior. ```bash $ restic -r s3:s3.amazonaws.com/backup-servers/restic snapshots ``` -------------------------------- ### List rclone remote bucket Source: https://restic.net/blog/2018-04-01/rclone-backend Lists files in the configured rclone remote 'b2prod' bucket 'yggdrasil' to verify access before using restic. ```bash $ rclone ls b2prod:yggdrasil ``` -------------------------------- ### restic forget and prune without dry-run Source: https://restic.net/blog/2016-08-22/removing-snapshots Runs forget without --dry-run to actually delete snapshots according to the policy, then runs restic prune to remove unreferenced data. The output shows 21 snapshots kept and 213 removed, followed by prune progress. ```bash $ restic forget --keep-daily 7 --keep-weekly 8 --keep-monthly 24 snapshots for host mopped, directories /home/fd0/tmp/data: keep 21 snapshots: ID Date Host Directory ---------------------------------------------------------------------- 5116cfdc 2016-08-22 05:00:00 mopped /home/fd0/tmp/data 6261b96f 2016-08-21 05:00:00 mopped /home/fd0/tmp/data d0267dbb 2016-08-20 05:00:00 mopped /home/fd0/tmp/data [...] remove 213 snapshots: [...] $ restic prune counting files in repo building new index for repo [0:00] 100.00% 1 / 1 files repository contains 1 packs (8 blobs) with 3.003 MiB bytes processed 8 blobs: 0 duplicate blobs, 0B duplicate load all snapshots find data that is still in use for 21 snapshots [0:00] 100.00% 21 / 21 snapshots found 8 of 8 data blobs still in use will rewrite 0 packs creating new index [0:00] 50.00% 1 / 2 files saved new index as 504caa39 done ``` -------------------------------- ### Sign the release archive with gpg --armor --detach-sign Source: https://restic.net/blog/2015-09-16/verifying-code-archive-integrity Create an ASCII-armored detached signature for the release archive. The command generates restic-0.1.0.tar.gz.asc. ```bash $ gpg --armor --detach-sign restic-0.1.0.tar.gz ``` -------------------------------- ### Dry-run forget with --keep-hourly 4 Source: https://restic.net/blog/2016-08-22/removing-snapshots Shows the output of restic forget --dry-run --keep-hourly 4, listing which snapshots would be kept and which would be removed. The output indicates 21 snapshots kept and 213 removed. ```bash $ restic forget --dry-run --keep-hourly 4 keep 21 snapshots: ID Date Host Directory ---------------------------------------------------------------------- 62df5e1e 2016-08-22 04:18:23 mopped /home/fd0/tmp/data 0b9fe168 2016-08-22 05:23:00 mopped /home/fd0/tmp/data 0fe0dcfe 2016-08-22 18:08:17 mopped /home/fd0/tmp/data 98fb9f00 2016-08-22 19:53:23 mopped /home/fd0/tmp/data remove 213 snapshots: ID Date Host Directory ---------------------------------------------------------------------- dbd30e0e 2016-08-22 03:00:00 mopped /home/fd0/tmp/data 45e789ca 2016-08-22 03:53:08 mopped /home/fd0/tmp/data c0411b71 2016-08-22 04:00:00 mopped /home/fd0/tmp/data 1f782cb4 2016-08-22 04:13:23 mopped /home/fd0/tmp/data d221a465 2016-08-22 19:24:00 mopped /home/fd0/tmp/data ``` -------------------------------- ### restic self-update with --output $(which restic) Source: https://restic.net/blog/2019-01-06/restic-0.9.4-released Upgrade restic from 0.9.3 to 0.9.4 using the self-update command. Due to a bug, you must specify where restic should write the new file, e.g., using the output of `which restic`. ```bash $ restic self-update --output $(which restic) ``` -------------------------------- ### restic S3 command without path showing error Source: https://restic.net/blog/2017-11-25/upcoming-changes-to-s3 Shows the error when accessing an existing repository without specifying a path in the S3 bucket after the change. The repository is now expected at the root of the bucket, so the old default path `/restic` is no longer used. ```bash $ restic -r s3:s3.amazonaws.com/backup-servers snapshots unable to open config file: Stat: The specified key does not exist. Is there a repository at the following location? s3:s3.amazonaws.com/backup-servers ``` -------------------------------- ### Remove unreferenced data with restic prune Source: https://restic.net/blog/2016-08-22/removing-snapshots Removes unreferenced data from the repository after snapshots have been forgotten. The output shows the progress and final index. This can take longer for larger repositories, especially when rewriting pack files. ```bash $ restic prune counting files in repo building new index for repo [0:00] 100.00% 1 / 1 files repository contains 1 packs (8 blobs) with 3.003 MiB bytes processed 8 blobs: 0 duplicate blobs, 0B duplicate load all snapshots find data that is still in use for 234 snapshots [0:00] 100.00% 234 / 234 snapshots found 8 of 8 data blobs still in use will rewrite 0 packs creating new index [0:00] 100.00% 2 / 2 files saved new index as 14a7838d done ``` -------------------------------- ### Remove a single snapshot with restic forget Source: https://restic.net/blog/2016-08-22/removing-snapshots Removes a single snapshot by ID using the forget command. The output confirms the removal and the subsequent snapshots listing shows the snapshot is gone. ```bash $ restic forget 6e001a58 removed snapshot 6e001a58 $ restic snapshots ID Date Host Directory ---------------------------------------------------------------------- 62a86121 2016-01-02 04:00:00 mopped /home/fd0/tmp/data ee891602 2016-01-03 04:00:00 mopped /home/fd0/tmp/data a07ffe20 2016-01-04 04:00:00 mopped /home/fd0/tmp/data [...] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.