github.com/advanderveer/restic@v0.8.1-0.20171209104529-42a8c19aaea6/doc/020_installation.rst (about)

     1  ..
     2    Normally, there are no heading levels assigned to certain characters as the structure is
     3    determined from the succession of headings. However, this convention is used in Python’s
     4    Style Guide for documenting which you may follow:
     5  
     6    # with overline, for parts
     7    * for chapters
     8    = for sections
     9    - for subsections
    10    ^ for subsubsections
    11    " for paragraphs
    12  
    13  ############
    14  Installation
    15  ############
    16  
    17  Packages
    18  ********
    19  
    20  Mac OS X
    21  ========
    22  
    23  If you are using Mac OS X, you can install restic using the
    24  `homebrew <http://brew.sh/>`__ package manager:
    25  
    26  .. code-block:: console
    27  
    28      $ brew install restic
    29  
    30  Arch Linux
    31  ==========
    32  
    33  On `Arch Linux <https://www.archlinux.org/>`__, there is a package called ``restic-git``
    34  which can be installed from AUR, e.g. with ``pacaur``:
    35  
    36  .. code-block:: console
    37  
    38      $ pacaur -S restic-git
    39  
    40  Nix & NixOS
    41  ===========
    42  
    43  If you are using `Nix <https://nixos.org/nix/>`__ or `NixOS <https://nixos.org/>`__
    44  there is a package available named ``restic``.
    45  It can be installed uisng ``nix-env``:
    46  
    47  .. code-block:: console
    48  
    49      $ nix-env --install restic 
    50  
    51  Debian
    52  ======
    53  
    54  On Debian, there's a package called ``restic`` which can be
    55  installed from the official repos, e.g. with ``apt-get``:
    56  
    57  .. code-block:: console
    58  
    59      $ apt-get install restic
    60  
    61  
    62  .. warning:: Please be aware that, at the time of writing, Debian *stable*
    63     has ``restic`` version 0.3.3 which is very old. The *testing* and *unstable*
    64     branches have recent versions of ``restic``.
    65  
    66  Pre-compiled Binary
    67  *******************
    68  
    69  You can download the latest pre-compiled binary from the `restic release
    70  page <https://github.com/restic/restic/releases/latest>`__.
    71  
    72  Docker Container
    73  ****************
    74  
    75  .. note::
    76     | A docker container is available as a contribution (Thank you!).
    77     | You can find it at https://github.com/Lobaro/restic-backup-docker
    78  
    79  From Source
    80  ***********
    81  
    82  restic is written in the Go programming language and you need at least
    83  Go version 1.8. Building restic may also work with older versions of Go,
    84  but that's not supported. See the `Getting
    85  started <https://golang.org/doc/install>`__ guide of the Go project for
    86  instructions how to install Go.
    87  
    88  In order to build restic from source, execute the following steps:
    89  
    90  .. code-block:: console
    91  
    92      $ git clone https://github.com/restic/restic
    93      [...]
    94  
    95      $ cd restic
    96  
    97      $ go run build.go
    98  
    99  You can easily cross-compile restic for all supported platforms, just
   100  supply the target OS and platform via the command-line options like this
   101  (for Windows and FreeBSD respectively):
   102  
   103  ::
   104  
   105      $ go run build.go --goos windows --goarch amd64
   106  
   107      $ go run build.go --goos freebsd --goarch 386
   108  
   109  The resulting binary is statically linked and does not require any
   110  libraries.
   111  
   112  At the moment, the only tested compiler for restic is the official Go
   113  compiler. Building restic with gccgo may work, but is not supported.
   114  
   115  Autocompletion
   116  **************
   117  
   118  Restic can write out a bash compatible autocompletion script:
   119  
   120  .. code-block:: console
   121  
   122      $ ./restic autocomplete --help
   123      The "autocomplete" command generates a shell autocompletion script.
   124  
   125      NOTE: The current version supports Bash only.
   126            This should work for *nix systems with Bash installed.
   127  
   128  By default, the file is written directly to ``/etc/bash_completion.d/``
   129  for convenience, and the command may need superuser rights, e.g.
   130  
   131  .. code-block:: console
   132  
   133      $ sudo restic autocomplete
   134  
   135      Usage:
   136        restic autocomplete [flags]
   137  
   138      Flags:
   139            --completionfile string   autocompletion file (default "/etc/bash_completion.d/restic.sh")
   140  
   141      Global Flags:
   142            --json                   set output mode to JSON for commands that support it
   143            --no-lock                do not lock the repo, this allows some operations on read-only repos
   144        -o, --option key=value       set extended option (key=value, can be specified multiple times)
   145        -p, --password-file string   read the repository password from a file
   146        -q, --quiet                  do not output comprehensive progress report
   147        -r, --repo string            repository to backup to or restore from (default: $RESTIC_REPOSITORY)
   148  
   149