Merge pull request #662 from jhemmje/master

Updated and verified examples in docs/
This commit is contained in:
TW 2016-02-16 00:22:49 +01:00
commit de79ac416a
3 changed files with 72 additions and 51 deletions

View File

@ -51,7 +51,7 @@ Restrictions
------------
Borg is instructed to restrict clients into their own paths:
``borg serve --restrict-path /home/backup/repos/<client fqdn>``
``borg serve --restrict-to-path /home/backup/repos/<client fqdn>``
There is only one ssh key per client allowed. Keys are added for ``johndoe.clnt.local``, ``web01.srv.local`` and
``app01.srv.local``. But they will access the backup under only one UNIX user account as:
@ -61,7 +61,7 @@ forced command and restrictions applied as shown below:
::
command="cd /home/backup/repos/<client fqdn>;
borg serve --restrict-path /home/backup/repos/<client fqdn>",
borg serve --restrict-to-path /home/backup/repos/<client fqdn>",
no-port-forwarding,no-X11-forwarding,no-pty,
no-agent-forwarding,no-user-rc <keytype> <key> <host>

View File

@ -53,28 +53,33 @@ A step by step example
output statistics about the newly created archive such as the amount of unique
data (not shared with other archives)::
------------------------------------------------------------------------------
Archive name: Tuesday
Archive fingerprint: 387a5e3f9b0e792e91ce87134b0f4bfe17677d9248cb5337f3fbf3a8e157942a
Start time: Tue Mar 25 12:00:10 2014
End time: Tue Mar 25 12:00:10 2014
Duration: 0.08 seconds
Number of files: 358
Original size Compressed size Deduplicated size
This archive: 57.16 MB 46.78 MB 151.67 kB
All archives: 114.02 MB 93.46 MB 44.81 MB
Archive fingerprint: bd31004d58f51ea06ff735d2e5ac49376901b21d58035f8fb05dbf866566e3c2
Start time: Tue Feb 16 18:15:11 2016
End time: Mon Feb 16 18:15:11 2016
Duration: 0.19 seconds
Number of files: 127
------------------------------------------------------------------------------
Original size Compressed size Deduplicated size
This archive: 4.16 MB 4.17 MB 26.78 kB
All archives: 8.33 MB 8.34 MB 4.19 MB
Unique chunks Total chunks
Chunk index: 132 261
------------------------------------------------------------------------------
4. List all archives in the repository::
$ borg list /mnt/backup
Monday Mon Mar 24 11:59:35 2014
Tuesday Tue Mar 25 12:00:10 2014
Monday Mon, 2016-02-15 19:14:44
Tuesday Tue, 2016-02-16 19:15:11
5. List the contents of the *Monday* archive::
$ borg list /mnt/backup::Monday
drwxr-xr-x user group 0 Jan 06 15:22 home/user/Documents
-rw-r--r-- user group 7961 Nov 17 2012 home/user/Documents/Important.doc
drwxr-xr-x user group 0 Mon, 2016-02-15 18:22:30 home/user/Documents
-rw-r--r-- user group 7961 Mon, 2016-02-15 18:22:30 home/user/Documents/Important.doc
...
6. Restore the *Monday* archive::
@ -216,4 +221,3 @@ mounting the remote filesystem, for example, using sshfs::
$ sshfs user@hostname:/mnt /mnt
$ borg init /mnt/backup
$ fusermount -u /mnt

View File

@ -305,11 +305,11 @@ Examples
$ borg create /mnt/backup::archivename ~
$ borg list /mnt/backup
archivename Mon Nov 2 20:40:06 2015
archivename Mon, 2016-02-15 19:50:19
$ borg rename /mnt/backup::archivename newname
$ borg list /mnt/backup
newname Mon Nov 2 20:40:06 2015
newname Mon, 2016-02-15 19:50:19
.. include:: usage/delete.rst.inc
@ -321,18 +321,18 @@ Examples
::
$ borg list /mnt/backup
my-files Thu Aug 1 23:33:22 2013
my-documents Thu Aug 1 23:35:43 2013
root-2013-08-01 Thu Aug 1 23:43:55 2013
root-2013-08-02 Fri Aug 2 15:18:17 2013
Monday Mon, 2016-02-15 19:15:11
repo Mon, 2016-02-15 19:26:54
root-2016-02-15 Mon, 2016-02-15 19:36:29
newname Mon, 2016-02-15 19:50:19
...
$ borg list /mnt/backup::root-2013-08-02
drwxr-xr-x root root 0 Jun 05 12:06 .
lrwxrwxrwx root root 0 May 31 20:40 bin -> usr/bin
drwxr-xr-x root root 0 Aug 01 22:08 etc
drwxr-xr-x root root 0 Jul 15 22:07 etc/ImageMagick-6
-rw-r--r-- root root 1383 May 22 22:25 etc/ImageMagick-6/colors.xml
$ borg list /mnt/backup::root-2016-02-15
drwxr-xr-x root root 0 Mon, 2016-02-15 17:44:27 .
drwxrwxr-x root root 0 Mon, 2016-02-15 19:04:49 bin
-rwxr-xr-x root root 1029624 Thu, 2014-11-13 00:08:51 bin/bash
lrwxrwxrwx root root 0 Fri, 2015-03-27 20:24:26 bin/bzcmp -> bzdiff
-rwxr-xr-x root root 2140 Fri, 2015-03-27 20:24:22 bin/bzdiff
...
@ -341,7 +341,7 @@ Examples
Examples
~~~~~~~~
Be careful, prune is potentially dangerous command, it will remove backup
Be careful, prune is a potentially dangerous command, it will remove backup
archives.
The default of prune is to apply to **all archives in the repository** unless
@ -376,17 +376,22 @@ Examples
~~~~~~~~
::
$ borg info /mnt/backup::root-2013-08-02
Name: root-2013-08-02
Fingerprint: bc3902e2c79b6d25f5d769b335c5c49331e6537f324d8d3badcb9a0917536dbb
$ borg info /mnt/backup::root-2016-02-15
Name: root-2016-02-15
Fingerprint: 57c827621f21b000a8d363c1e163cc55983822b3afff3a96df595077a660be50
Hostname: myhostname
Username: root
Time: Fri Aug 2 15:18:17 2013
Command line: /usr/bin/borg create --stats -C zlib,6 /mnt/backup::root-2013-08-02 / --one-file-system
Number of files: 147429
Original size: 5344169493 (4.98 GB)
Compressed size: 1748189642 (1.63 GB)
Unique data: 64805454 (61.80 MB)
Time (start): Mon, 2016-02-15 19:36:29
Time (end): Mon, 2016-02-15 19:39:26
Command line: /usr/local/bin/borg create -v --list -C zlib,6 /mnt/backup::root-2016-02-15 / --one-file-system
Number of files: 38100
Original size Compressed size Deduplicated size
This archive: 1.33 GB 613.25 MB 571.64 MB
All archives: 1.63 GB 853.66 MB 584.12 MB
Unique chunks Total chunks
Chunk index: 36858 48844
.. include:: usage/mount.rst.inc
@ -395,9 +400,9 @@ Examples
~~~~~~~~
::
$ borg mount /mnt/backup::root-2013-08-02 /tmp/mymountpoint
$ borg mount /mnt/backup::root-2016-02-15 /tmp/mymountpoint
$ ls /tmp/mymountpoint
bin boot etc lib lib64 mnt opt root sbin srv usr var
bin boot etc home lib lib64 lost+found media mnt opt root sbin srv tmp usr var
$ fusermount -u /tmp/mymountpoint
@ -408,19 +413,24 @@ Examples
::
# Create a key file protected repository
$ borg init --encryption=keyfile /mnt/backup
$ borg init --encryption=keyfile -v /mnt/backup
Initializing repository at "/mnt/backup"
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Key file "/home/USER/.config/borg/keys/mnt_backup" created.
Keep this file safe. Your data will be inaccessible without it.
Enter new passphrase:
Enter same passphrase again:
Remember your passphrase. Your data will be inaccessible without it.
Key in "/root/.config/borg/keys/mnt_backup" created.
Keep this key safe. Your data will be inaccessible without it.
Synchronizing chunks cache...
Archives: 0, w/ cached Idx: 0, w/ outdated Idx: 0, w/o cached Idx: 0.
Done.
# Change key file passphrase
$ borg change-passphrase /mnt/backup
Enter passphrase for key file /home/USER/.config/borg/keys/mnt_backup:
New passphrase:
Enter same passphrase again:
Key file "/home/USER/.config/borg/keys/mnt_backup" updated
$ borg change-passphrase -v /mnt/backup
Enter passphrase for key /root/.config/borg/keys/mnt_backup:
Enter new passphrase:
Enter same passphrase again:
Remember your passphrase. Your data will be inaccessible without it.
Key updated
.. include:: usage/serve.rst.inc
@ -451,7 +461,15 @@ Examples
~~~~~~~~
::
borg upgrade -v /mnt/backup
# Upgrade the borg repository to the most recent version.
$ borg upgrade -v /mnt/backup
making a hardlink copy in /mnt/backup.upgrade-2016-02-15-20:51:55
opening attic repository with borg and converting
no key file found for repository
converting repo index /mnt/backup/index.0
converting 1 segments...
converting borg 0.xx to borg current
no key file found for repository
Miscellaneous Help
@ -620,4 +638,3 @@ Now, let's see how to restore some LVs from such a backup. ::
$ # we assume that you created an empty root and home LV and overwrite it now:
$ borg extract --stdout /mnt/backup::repo dev/vg0/root-snapshot > /dev/vg0/root
$ borg extract --stdout /mnt/backup::repo dev/vg0/home-snapshot > /dev/vg0/home