2017-08-05 09:42:37 +00:00
.nh
2023-10-24 18:02:55 +00:00
.TH "restic backup" "1" "Jan 2017" "generated by \fBrestic generate\fR" ""
2017-08-05 09:42:37 +00:00
.SH NAME
.PP
2022-08-25 17:55:00 +00:00
restic-backup - Create a new backup of files and/or directories
2017-08-05 09:42:37 +00:00
.SH SYNOPSIS
.PP
2022-08-25 17:55:00 +00:00
\fB restic backup [flags] [FILE/DIR] ...\fP
2017-08-05 09:42:37 +00:00
.SH DESCRIPTION
.PP
The "backup" command creates a new snapshot and saves the files and directories
given as the arguments.
2020-09-19 15:38:26 +00:00
.SH EXIT STATUS
.PP
Exit status is 0 if the command was successful.
Exit status is 1 if there was a fatal error (no snapshot created).
Exit status is 3 if some source data could not be read (incomplete snapshot created).
2024-07-26 09:30:37 +00:00
Exit status is 10 if the repository does not exist.
Exit status is 11 if the repository is already locked.
2024-09-05 19:25:21 +00:00
Exit status is 12 if the password is incorrect.
2020-09-19 15:38:26 +00:00
2017-08-05 09:42:37 +00:00
.SH OPTIONS
2022-03-26 19:09:59 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB -n\fP , \fB --dry-run\fP [=false]
2022-03-26 19:09:59 +00:00
do not upload or write any data, just show what would be done
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB -e\fP , \fB --exclude\fP =[]
2023-10-24 18:02:55 +00:00
exclude a \fB pattern\fR (can be specified multiple times)
2017-08-05 09:42:37 +00:00
2017-08-19 20:44:18 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --exclude-caches\fP [=false]
2021-08-03 09:45:36 +00:00
excludes cache directories that are marked with a CACHEDIR.TAG file. See https://bford.info/cachedir/ for the Cache Directory Tagging Standard
2017-08-19 20:44:18 +00:00
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --exclude-file\fP =[]
2023-10-24 18:02:55 +00:00
read exclude patterns from a \fB file\fR (can be specified multiple times)
2017-08-05 09:42:37 +00:00
2017-08-19 20:44:18 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --exclude-if-present\fP =[]
2023-10-24 18:02:55 +00:00
takes \fB filename[:header]\fR , exclude contents of directories containing filename (except filename itself) if header of that file is as provided (can be specified multiple times)
2020-09-19 15:38:26 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --exclude-larger-than\fP =""
2023-10-24 18:02:55 +00:00
max \fB size\fR of the files to be backed up (allowed suffixes: k/K, m/M, g/G, t/T)
2017-08-19 20:44:18 +00:00
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --files-from\fP =[]
2023-10-24 18:02:55 +00:00
read the files to backup from \fB file\fR (can be combined with file args; can be specified multiple times)
2021-02-14 10:44:20 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --files-from-raw\fP =[]
2023-10-24 18:02:55 +00:00
read the files to backup from \fB file\fR (can be combined with file args; can be specified multiple times)
2021-02-14 10:44:20 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --files-from-verbatim\fP =[]
2023-10-24 18:02:55 +00:00
read the files to backup from \fB file\fR (can be combined with file args; can be specified multiple times)
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB -f\fP , \fB --force\fP [=false]
2024-07-26 09:30:37 +00:00
force re-reading the source files/directories (overrides the "parent" flag)
2017-08-05 09:42:37 +00:00
2023-07-31 18:23:24 +00:00
.PP
\fB -g\fP , \fB --group-by\fP =host,paths
2023-10-24 18:02:55 +00:00
\fB group\fR snapshots by host, paths and/or tags, separated by comma (disable grouping with '')
2023-07-31 18:23:24 +00:00
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB -h\fP , \fB --help\fP [=false]
2021-08-03 09:45:36 +00:00
help for backup
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB -H\fP , \fB --host\fP =""
2024-07-26 09:30:37 +00:00
set the \fB hostname\fR for the snapshot manually (default: $RESTIC_HOST). To prevent an expensive rescan use the "parent" flag
2017-08-05 09:42:37 +00:00
2019-04-23 11:19:39 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --iexclude\fP =[]
2023-10-24 18:02:55 +00:00
same as --exclude \fB pattern\fR but ignores the casing of filenames
2020-09-19 15:38:26 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --iexclude-file\fP =[]
2023-10-24 18:02:55 +00:00
same as --exclude-file but ignores casing of \fB file\fR names in patterns
2019-04-23 11:19:39 +00:00
2021-02-14 10:44:20 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --ignore-ctime\fP [=false]
2021-08-03 09:45:36 +00:00
ignore ctime changes when checking for modified files
2021-02-14 10:44:20 +00:00
2019-04-23 11:19:39 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --ignore-inode\fP [=false]
2024-07-26 09:30:37 +00:00
ignore inode number and ctime changes when checking for modified files
2019-04-23 11:19:39 +00:00
2023-01-12 19:51:19 +00:00
.PP
\fB --no-scan\fP [=false]
do not run scanner to estimate size of backup
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB -x\fP , \fB --one-file-system\fP [=false]
2021-08-03 09:45:36 +00:00
exclude other file systems, don't cross filesystem boundaries and subvolumes
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --parent\fP =""
2023-10-24 18:02:55 +00:00
use this parent \fB snapshot\fR (default: latest snapshot in the group determined by --group-by and not newer than the timestamp determined by --time)
2017-08-05 09:42:37 +00:00
2023-01-12 19:51:19 +00:00
.PP
\fB --read-concurrency\fP =0
2023-10-24 18:02:55 +00:00
read \fB n\fR files concurrently (default: $RESTIC_READ_CONCURRENCY or 2)
2023-01-12 19:51:19 +00:00
2024-07-26 09:30:37 +00:00
.PP
\fB --skip-if-unchanged\fP [=false]
skip snapshot creation if identical to parent snapshot
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --stdin\fP [=false]
2021-08-03 09:45:36 +00:00
read backup from stdin
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --stdin-filename\fP ="stdin"
2023-10-24 18:02:55 +00:00
\fB filename\fR to use when reading from stdin
2017-08-05 09:42:37 +00:00
2024-07-26 09:30:37 +00:00
.PP
\fB --stdin-from-command\fP [=false]
interpret arguments as command to execute and store its stdout
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --tag\fP =[]
2023-10-24 18:02:55 +00:00
add \fB tags\fR for the new snapshot in the format \fB tag[,tag,...]\fR (can be specified multiple times)
2017-08-05 09:42:37 +00:00
2017-09-09 10:10:38 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --time\fP =""
2023-10-24 18:02:55 +00:00
\fB time\fR of the backup (ex. '2012-11-01 22:08:41') (default: now)
2017-09-09 10:10:38 +00:00
2017-12-27 21:31:03 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --with-atime\fP [=false]
2021-08-03 09:45:36 +00:00
store the atime for all files and directories
2017-12-27 21:31:03 +00:00
2017-08-05 09:42:37 +00:00
.SH OPTIONS INHERITED FROM PARENT COMMANDS
2017-11-26 18:46:16 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --cacert\fP =[]
2023-10-24 18:02:55 +00:00
\fB file\fR to load root certificates from (default: use system certificates or $RESTIC_CACERT)
2017-11-26 18:46:16 +00:00
2017-09-24 21:13:04 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --cache-dir\fP =""
2023-10-24 18:02:55 +00:00
set the cache \fB directory\fR \& . (default: use system default cache directory)
2017-09-24 21:13:04 +00:00
2017-12-27 21:31:03 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --cleanup-cache\fP [=false]
2021-08-03 09:45:36 +00:00
auto remove old cache directories
2017-12-27 21:31:03 +00:00
2022-03-26 19:09:59 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --compression\fP =auto
2023-07-31 18:23:24 +00:00
compression mode (only available for repository format version 2), one of (auto|off|max) (default: $RESTIC_COMPRESSION)
2022-03-26 19:09:59 +00:00
2024-07-26 09:30:37 +00:00
.PP
\fB --http-user-agent\fP =""
set a http user agent for outgoing http requests
.PP
\fB --insecure-no-password\fP [=false]
use an empty password for the repository, must be passed to every restic command (insecure)
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --insecure-tls\fP [=false]
skip TLS certificate verification when connecting to the repository (insecure)
.PP
\fB --json\fP [=false]
2021-08-03 09:45:36 +00:00
set output mode to JSON for commands that support it
2017-08-05 09:42:37 +00:00
2019-01-06 20:40:32 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --key-hint\fP =""
2023-10-24 18:02:55 +00:00
\fB key\fR ID of key to try decrypting first (default: $RESTIC_KEY_HINT)
2019-01-06 20:40:32 +00:00
2017-11-26 18:46:16 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --limit-download\fP =0
2023-10-24 18:02:55 +00:00
limits downloads to a maximum \fB rate\fR in KiB/s. (default: unlimited)
2017-11-26 18:46:16 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --limit-upload\fP =0
2023-10-24 18:02:55 +00:00
limits uploads to a maximum \fB rate\fR in KiB/s. (default: unlimited)
2017-11-26 18:46:16 +00:00
2017-09-24 21:13:04 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --no-cache\fP [=false]
2021-08-03 09:45:36 +00:00
do not use a local cache
2017-09-24 21:13:04 +00:00
2024-02-04 18:50:51 +00:00
.PP
\fB --no-extra-verify\fP [=false]
skip additional verification of data before upload (see documentation)
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --no-lock\fP [=false]
do not lock the repository, this allows some operations on read-only repositories
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB -o\fP , \fB --option\fP =[]
2023-10-24 18:02:55 +00:00
set extended option (\fB key=value\fR , can be specified multiple times)
2017-08-05 09:42:37 +00:00
2019-01-06 20:40:32 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --pack-size\fP =0
2023-10-24 18:02:55 +00:00
set target pack \fB size\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE)
2022-08-25 17:55:00 +00:00
.PP
\fB --password-command\fP =""
2023-10-24 18:02:55 +00:00
shell \fB command\fR to obtain the repository password from (default: $RESTIC_PASSWORD_COMMAND)
2019-01-06 20:40:32 +00:00
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB -p\fP , \fB --password-file\fP =""
2023-10-24 18:02:55 +00:00
\fB file\fR to read the repository password from (default: $RESTIC_PASSWORD_FILE)
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB -q\fP , \fB --quiet\fP [=false]
2021-08-03 09:45:36 +00:00
do not output comprehensive progress report
2017-08-05 09:42:37 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB -r\fP , \fB --repo\fP =""
2023-10-24 18:02:55 +00:00
\fB repository\fR to backup to or restore from (default: $RESTIC_REPOSITORY)
2020-11-05 08:41:35 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --repository-file\fP =""
2023-10-24 18:02:55 +00:00
\fB file\fR to read the repository location from (default: $RESTIC_REPOSITORY_FILE)
2017-08-05 09:42:37 +00:00
2023-07-31 18:23:24 +00:00
.PP
\fB --retry-lock\fP =0s
retry to lock the repository if it is already locked, takes a value like 5m or 2h (default: no retries)
2024-09-05 19:25:21 +00:00
.PP
\fB --stuck-request-timeout\fP =5m0s
\fB duration\fR after which to retry stuck requests
2018-02-17 19:27:28 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB --tls-client-cert\fP =""
2023-10-24 18:02:55 +00:00
path to a \fB file\fR containing PEM encoded TLS client certificate and private key (default: $RESTIC_TLS_CLIENT_CERT)
2018-02-17 19:27:28 +00:00
2018-05-21 13:57:32 +00:00
.PP
2022-08-25 17:55:00 +00:00
\fB -v\fP , \fB --verbose\fP [=0]
2023-04-24 18:28:37 +00:00
be verbose (specify multiple times or a level using --verbose=n``, max level/times is 2)
2018-05-21 13:57:32 +00:00
2017-08-05 09:42:37 +00:00
.SH SEE ALSO
.PP
\fB restic(1)\fP