1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-22 07:43:03 +00:00

doc: move quickstart to docs

This commit is contained in:
Michael Eischer 2023-07-23 12:09:01 +02:00
parent 5bd8a6d7eb
commit ae13cf15c1
3 changed files with 51 additions and 37 deletions

View file

@ -1,6 +0,0 @@
Enhancement: Extend cli help output
Added a short overview of the most important commands to the commandline
help output to help new users get started.
https://github.com/restic/restic/pull/3225

View file

@ -18,40 +18,16 @@ import (
"github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/errors"
) )
// LongDescription is shown in the cli help output
const LongDescription = `
restic is a backup program which allows saving multiple revisions of files and
directories in an encrypted repository stored on different backends.
To get started with a local test repository, first define some environment variables:
export RESTIC_REPOSITORY=/tmp/restic-example
export RESTIC_PASSWORD=some-strong-password
Initialize the repository (first time only):
restic init
Create your first backup:
restic backup /etc/hosts
You can list all the snapshots you created with:
restic snapshots
You can restore a backup by noting the snapshot ID you want and running:
restic restore --target /tmp/some-target-dir your-snapshot-ID
It is a good idea to periodically check your repository's metadata:
restic check
# or full data:
restic check --read-data
The full documentation can be found at https://restic.readthedocs.io/
`
// cmdRoot is the base command when no other command has been specified. // cmdRoot is the base command when no other command has been specified.
var cmdRoot = &cobra.Command{ var cmdRoot = &cobra.Command{
Use: "restic", Use: "restic",
Short: "Backup and restore files", Short: "Backup and restore files",
Long: LongDescription, Long: `
restic is a backup program which allows saving multiple revisions of files and
directories in an encrypted repository stored on different backends.
The full documentation can be found at https://restic.readthedocs.io/ .
`,
SilenceErrors: true, SilenceErrors: true,
SilenceUsage: true, SilenceUsage: true,
DisableAutoGenTag: true, DisableAutoGenTag: true,

View file

@ -17,3 +17,47 @@ Introduction
Restic is a fast and secure backup program. In the following sections, we will Restic is a fast and secure backup program. In the following sections, we will
present typical workflows, starting with installing, preparing a new present typical workflows, starting with installing, preparing a new
repository, and making the first backup. repository, and making the first backup.
Quickstart Guide
****************
To get started with a local repository, first define some environment variables:
.. code-block:: console
export RESTIC_REPOSITORY=/srv/restic-repo
export RESTIC_PASSWORD=some-strong-password
Initialize the repository (first time only):
.. code-block:: console
restic init
Create your first backup:
.. code-block:: console
restic backup ~/work
You can list all the snapshots you created with:
.. code-block:: console
restic snapshots
You can restore a backup by noting the snapshot ID you want and running:
.. code-block:: console
restic restore --target /tmp/restore-work your-snapshot-ID
It is a good idea to periodically check your repository's metadata:
.. code-block:: console
restic check
# or full data:
restic check --read-data
For more details continue reading the next sections.