1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-24 00:37:56 +00:00
borg/docs/generalusage.rst

94 lines
3 KiB
ReStructuredText
Raw Normal View History

2013-06-29 21:56:44 +00:00
.. include:: global.rst.inc
.. _generalusage:
General Usage
=============
2013-07-03 20:38:07 +00:00
The following examples showcases how to use |project_name| to backup some
2013-07-05 10:32:56 +00:00
important files from a users home directory (for more detailed information
about each subcommand see the :ref:`detailed_usage` section).
2013-06-29 21:56:44 +00:00
2013-07-03 20:38:07 +00:00
Initialize a local :ref:`repository <repository_def>` to store backup
:ref:`archives <archive_def>` in (See :ref:`encrypted_repos` and
:ref:`remote_repos` for more details)::
2013-06-29 21:56:44 +00:00
2013-07-08 21:38:27 +00:00
$ attic init /somewhere/my-backup.attic
2013-06-29 21:56:44 +00:00
Create an archive containing the ``~/src`` and ``~/Documents`` directories::
2013-07-08 21:38:27 +00:00
$ attic create -v /somwhere/my-backup.attic::first-backup ~/src ~/Documents
2013-06-29 21:56:44 +00:00
2013-07-03 20:38:07 +00:00
Create another archive the next day. This backup will be a lot quicker since
only new data is stored. The ``--stats`` option tells |project_name| to print
statistics about the newly created archive such as the amount of unique data
(not shared with other archives)::
2013-06-29 21:56:44 +00:00
2013-07-08 21:38:27 +00:00
$ attic create -v --stats /somwhere/my-backup.attic::second-backup ~/src ~/Documents
2013-06-29 21:56:44 +00:00
List all archives in the repository::
2013-07-08 21:38:27 +00:00
$ attic list /somewhere/my-backup.attic
2013-06-29 21:56:44 +00:00
List the files in the *first-backup* archive::
2013-07-08 21:38:27 +00:00
$ attic list /somewhere/my-backup.attic::first-backup
2013-06-29 21:56:44 +00:00
Restore the *first-backup* archive::
2013-07-08 21:38:27 +00:00
$ attic extract -v /somwhere/my-backup.attic::first-backup
2013-06-29 21:56:44 +00:00
Recover disk space by manually deleting the *first-backup* archive::
2013-07-08 21:38:27 +00:00
$ attic delete /somwhere/my-backup.attic::first-backup
2013-06-29 21:56:44 +00:00
2013-07-03 20:38:07 +00:00
Use the ``prune`` subcommand to delete all archives except a given number of
*daily*, *weekly*, *monthly* and *yearly* archives::
2013-06-29 21:56:44 +00:00
2013-07-08 21:38:27 +00:00
$ attic prune /somwhere/my-backup.attic --daily=7 --weekly=2 --monthly=6
2013-06-29 21:56:44 +00:00
.. _encrypted_repos:
Repository encryption
---------------------
Repository encryption is enabled at repository encryption time::
2013-07-08 21:38:27 +00:00
$ attic init --passphrase | --key-file
2013-06-29 21:56:44 +00:00
2013-07-03 20:38:07 +00:00
When repository encryption is enabled all data is encrypted using 256-bit AES_
encryption and the integrity and authenticity is verified using `HMAC-SHA256`_.
2013-06-29 21:56:44 +00:00
|project_name| supports two different methods to derive the AES and HMAC keys.
Passphrase based encryption
This method uses a user supplied passphrase to derive the keys using the
PBKDF2_ key derivation function. This method is convenient to use and
secure as long as a *strong* passphrase is used.
Key file based encryption
2013-07-03 20:38:07 +00:00
This method generates random keys at repository initialization time that
2013-07-08 21:38:27 +00:00
are stored in a password protected file in the ``~/.attic/keys/`` directory.
2013-06-29 21:56:44 +00:00
This method is secure and suitable for automated backups.
.. Note::
The repository data is totally inaccessible without the key file
so it must be kept **safe**.
.. _remote_repos:
Remote repositories
-------------------
2013-07-03 20:38:07 +00:00
|project_name| can initialize and access repositories on remote hosts as the
host is accessible using SSH and |project_name| is installed.
2013-06-29 21:56:44 +00:00
The following syntax is used to address remote repositories::
2013-07-08 21:38:27 +00:00
$ attic init user@hostname:repository.attic
2013-06-29 21:56:44 +00:00
or::
2013-07-08 21:38:27 +00:00
$ attic init ssh://user@hostname:port/repository.attic