backup

command
v0.0.0-...-c1cc133 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Command backup writes a zip-formatted backup archive to stdout.

usage: backup [-files] [-size] [other flags]

Mode flags:
    -files  print file names that a new backup will include
    -size   print size of a new backup

Flags for "-files" mode:
    -a      print all items, do not drop noisy paths

By default, known noisy paths, such as .git directories, node_modules directories, and .DS_Store files, are dropped from the files output ("-files" flag); however these paths, if present, will be included in actual backup.

Configuration

By default a backup will include no files. A configuration file specifies paths to back up. Empty lines and lines beginning with '#' in the configuration file are ignored. Whitespace at the start and the end of a line is ignored. Configuration lines have one of these forms:

include path <path>
exclude path <path>
exclude pattern <pattern>

An "include" line specifies a path to include in a backup. If the specified path is a directory, all items under the directory tree are included. It is an error if no items match an "include" line. Only regular files, directories, and symbolic links are backed up; other file types are quietly skipped. Symbolic links are not followed.

An "exclude" line specifies a path or a regexp pattern in Go syntax. Files and directories that match the path or the pattern are excluded from a backup, even if they would otherwise be included due to a "include" line elsewhere in the file.

Paths must be absolute paths.

The variables $HOME and ${HOME} in paths and patterns will be expanded before use (other variables are not expanded). Paths and patterns should generally not be quoted; if, for example, a path is quoted, then the quotes are considered to be part of the path value itself. Note that the order of lines in the configuration file effectively does not matter.

Backup output

Each backup is a zip file that is written to stdout. Zip files support compression, provide per-item checksums, and allow random access of items, which is useful for browsing or selectively restoring files from a backup.

Environment & files

The following environment variables are used by the program.

HOME  User home directory

The following files are used by the program.

$HOME/.config/backup/paths.txt  Configuration file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL