doc: slightly modernize backup examples

This commit is contained in:
Michael Eischer 2024-05-22 16:39:10 +02:00
parent 5649334099
commit 513135b238
4 changed files with 26 additions and 29 deletions

View file

@ -24,16 +24,17 @@ again:
$ restic -r /srv/restic-repo --verbose backup ~/work $ restic -r /srv/restic-repo --verbose backup ~/work
open repository open repository
enter password for repository: enter password for repository:
password is correct repository a14e5863 opened (version 2, compression level auto)
lock repository
load index files load index files
start scan start scan on [/home/user/work]
start backup start backup on [/home/user/work]
scan finished in 1.837s scan finished in 1.837s: 5307 files, 1.720 GiB
processed 1.720 GiB in 0:12
Files: 5307 new, 0 changed, 0 unmodified Files: 5307 new, 0 changed, 0 unmodified
Dirs: 1867 new, 0 changed, 0 unmodified Dirs: 1867 new, 0 changed, 0 unmodified
Added: 1.200 GiB Added to the repository: 1.200 GiB (1.103 GiB stored)
processed 5307 files, 1.720 GiB in 0:12
snapshot 40dc1520 saved snapshot 40dc1520 saved
As you can see, restic created a backup of the directory and was pretty As you can see, restic created a backup of the directory and was pretty
@ -44,6 +45,7 @@ You can see that restic tells us it processed 1.720 GiB of data, this is the
size of the files and directories in ``~/work`` on the local file system. It size of the files and directories in ``~/work`` on the local file system. It
also tells us that only 1.200 GiB was added to the repository. This means that also tells us that only 1.200 GiB was added to the repository. This means that
some of the data was duplicate and restic was able to efficiently reduce it. some of the data was duplicate and restic was able to efficiently reduce it.
The data compression also managed to compress the data down to 1.103 GiB.
If you don't pass the ``--verbose`` option, restic will print less data. You'll If you don't pass the ``--verbose`` option, restic will print less data. You'll
still get a nice live status display. Be aware that the live status shows the still get a nice live status display. Be aware that the live status shows the
@ -109,17 +111,18 @@ repository (since all data is already there). This is de-duplication at work!
$ restic -r /srv/restic-repo --verbose backup ~/work $ restic -r /srv/restic-repo --verbose backup ~/work
open repository open repository
enter password for repository: enter password for repository:
password is correct repository a14e5863 opened (version 2, compression level auto)
lock repository
load index files load index files
using parent snapshot d875ae93 using parent snapshot 40dc1520
start scan start scan on [/home/user/work]
start backup start backup on [/home/user/work]
scan finished in 1.881s scan finished in 1.881s: 5307 files, 1.720 GiB
processed 1.720 GiB in 0:03
Files: 0 new, 0 changed, 5307 unmodified Files: 0 new, 0 changed, 5307 unmodified
Dirs: 0 new, 0 changed, 1867 unmodified Dirs: 0 new, 0 changed, 1867 unmodified
Added: 0 B Added to the repository: 0 B (0 B stored)
processed 5307 files, 1.720 GiB in 0:03
snapshot 79766175 saved snapshot 79766175 saved
You can even backup individual files in the same repository (not passing You can even backup individual files in the same repository (not passing
@ -129,7 +132,6 @@ You can even backup individual files in the same repository (not passing
$ restic -r /srv/restic-repo backup ~/work.txt $ restic -r /srv/restic-repo backup ~/work.txt
enter password for repository: enter password for repository:
password is correct
snapshot 249d0210 saved snapshot 249d0210 saved
If you're interested in what restic does, pass ``--verbose`` twice (or If you're interested in what restic does, pass ``--verbose`` twice (or
@ -143,7 +145,6 @@ restic encounters:
$ restic -r /srv/restic-repo --verbose --verbose backup ~/work.txt $ restic -r /srv/restic-repo --verbose --verbose backup ~/work.txt
open repository open repository
enter password for repository: enter password for repository:
password is correct
lock repository lock repository
load index files load index files
using parent snapshot f3f8d56b using parent snapshot f3f8d56b
@ -255,7 +256,7 @@ the corresponding folder and use relative paths.
using parent snapshot 40dc1520 using parent snapshot 40dc1520
start scan on [.] start scan on [.]
start backup on [.] start backup on [.]
scan finished in 1.814s: 5307 files, 1.200GiB scan finished in 1.814s: 5307 files, 1.720 GiB
Files: 0 new, 0 changed, 5307 unmodified Files: 0 new, 0 changed, 5307 unmodified
Dirs: 0 new, 0 changed, 1867 unmodified Dirs: 0 new, 0 changed, 1867 unmodified
@ -503,7 +504,6 @@ and displays a small statistic, just pass the command two snapshot IDs:
.. code-block:: console .. code-block:: console
$ restic -r /srv/restic-repo diff 5845b002 2ab627a6 $ restic -r /srv/restic-repo diff 5845b002 2ab627a6
password is correct
comparing snapshot ea657ce5 to 2ab627a6: comparing snapshot ea657ce5 to 2ab627a6:
C /restic/cmd_diff.go C /restic/cmd_diff.go

View file

@ -163,8 +163,8 @@ example from a local to a remote repository, you can use the ``copy`` command:
.. code-block:: console .. code-block:: console
$ restic -r /srv/restic-repo-copy copy --from-repo /srv/restic-repo $ restic -r /srv/restic-repo-copy copy --from-repo /srv/restic-repo
repository d6504c63 opened successfully, password is correct repository d6504c63 opened successfully
repository 3dd0878c opened successfully, password is correct repository 3dd0878c opened successfully
snapshot 410b18a2 of [/home/user/work] at 2020-06-09 23:15:57.305305 +0200 CEST by user@kasimir snapshot 410b18a2 of [/home/user/work] at 2020-06-09 23:15:57.305305 +0200 CEST by user@kasimir
copy started, this may take a while... copy started, this may take a while...
@ -263,7 +263,7 @@ the unwanted files from affected snapshots by rewriting them using the
.. code-block:: console .. code-block:: console
$ restic -r /srv/restic-repo rewrite --exclude secret-file $ restic -r /srv/restic-repo rewrite --exclude secret-file
repository c881945a opened (repository version 2) successfully, password is correct repository c881945a opened (repository version 2) successfully
snapshot 6160ddb2 of [/home/user/work] at 2022-06-12 16:01:28.406630608 +0200 CEST by user@kasimir snapshot 6160ddb2 of [/home/user/work] at 2022-06-12 16:01:28.406630608 +0200 CEST by user@kasimir
excluding /home/user/work/secret-file excluding /home/user/work/secret-file
@ -274,7 +274,7 @@ the unwanted files from affected snapshots by rewriting them using the
modified 1 snapshots modified 1 snapshots
$ restic -r /srv/restic-repo rewrite --exclude secret-file 6160ddb2 $ restic -r /srv/restic-repo rewrite --exclude secret-file 6160ddb2
repository c881945a opened (repository version 2) successfully, password is correct repository c881945a opened (repository version 2) successfully
snapshot 6160ddb2 of [/home/user/work] at 2022-06-12 16:01:28.406630608 +0200 CEST by user@kasimir snapshot 6160ddb2 of [/home/user/work] at 2022-06-12 16:01:28.406630608 +0200 CEST by user@kasimir
excluding /home/user/work/secret-file excluding /home/user/work/secret-file

View file

@ -80,7 +80,7 @@ command must be run:
$ restic -r /srv/restic-repo prune $ restic -r /srv/restic-repo prune
enter password for repository: enter password for repository:
repository 33002c5e opened successfully, password is correct repository 33002c5e opened successfully
loading all snapshots... loading all snapshots...
loading indexes... loading indexes...
finding data that is still in use for 4 snapshots finding data that is still in use for 4 snapshots
@ -265,7 +265,7 @@ Sunday for 12 weeks:
.. code-block:: console .. code-block:: console
$ restic snapshots $ restic snapshots
repository f00c6e2a opened successfully, password is correct repository f00c6e2a opened successfully
ID Time Host Tags Paths ID Time Host Tags Paths
--------------------------------------------------------------- ---------------------------------------------------------------
0a1f9759 2019-09-01 11:00:00 mopped /home/user/work 0a1f9759 2019-09-01 11:00:00 mopped /home/user/work
@ -289,7 +289,7 @@ four Sundays, and remove the other snapshots:
.. code-block:: console .. code-block:: console
$ restic forget --keep-daily 4 --dry-run $ restic forget --keep-daily 4 --dry-run
repository f00c6e2a opened successfully, password is correct repository f00c6e2a opened successfully
Applying Policy: keep the last 4 daily snapshots Applying Policy: keep the last 4 daily snapshots
keep 4 snapshots: keep 4 snapshots:
ID Time Host Tags Reasons Paths ID Time Host Tags Reasons Paths

View file

@ -329,7 +329,6 @@ required to restore the latest snapshot (from any host that made it):
.. code-block:: console .. code-block:: console
$ restic stats latest $ restic stats latest
password is correct
Total File Count: 10538 Total File Count: 10538
Total Size: 37.824 GiB Total Size: 37.824 GiB
@ -340,7 +339,6 @@ host by using the ``--host`` flag:
.. code-block:: console .. code-block:: console
$ restic stats --host myserver latest $ restic stats --host myserver latest
password is correct
Total File Count: 21766 Total File Count: 21766
Total Size: 481.783 GiB Total Size: 481.783 GiB
@ -357,7 +355,6 @@ has restic's deduplication helped? We can check:
.. code-block:: console .. code-block:: console
$ restic stats --host myserver --mode raw-data latest $ restic stats --host myserver --mode raw-data latest
password is correct
Total Blob Count: 340847 Total Blob Count: 340847
Total Size: 458.663 GiB Total Size: 458.663 GiB