lbu - manage local backups for diskless Alpine Linux
systems
lbu SUBCOMMAND [OPTIONS] [ARGS]
lbu manages Alpine local backup overlays. It tracks files
to include or exclude, creates apkovl archives, commits them to removable
media or a backup directory, and compares or reverts saved overlays.
The default file set is provided by the apk backup audit.
Additional include and exclude entries are stored in the lbu protected paths
file. Included entries use a leading "+". Excluded entries use a
leading "-".
include, inc, add [-rv] FILE...
Add files to the include list. Leading "/"
characters are stripped before entries are stored.
include, inc, add [-v] -l
List files in the include list.
exclude, ex, delete [-rv] FILE...
Add files to the exclude list. If a file is present in
the include list, it is removed from there.
exclude, ex, delete [-v] -l
List files in the exclude list.
list, ls
List files that would be written to an apkovl
archive.
package, pkg [-v] [DIR | FILE]
Create an apkovl archive. If DIR is specified, the
archive is written there using the default apkovl filename. If FILE is
specified and is not a directory, that filename is used. With no argument, the
archive is written to the current directory.
commit, ci [-denv] [-p PASSWORD]
[MEDIA]
Create an apkovl archive and save it to writable media or
$LBU_BACKUPDIR. If MEDIA is not specified, LBU_BACKUPDIR
or LBU_MEDIA is used. If LBU_BACKUPDIR is set, no media is
mounted.
list-backup, lb [MEDIA]
List timestamped backup archives from MEDIA or
$LBU_BACKUPDIR.
revert REVISION [MEDIA]
Replace the current apkovl archive with REVISION.
The current archive is backed up before the revision is moved into
place.
status, stat, st [-av]
Show changes compared with the last committed apkovl.
Output is prefixed with "A" for added files, "D" for
deleted files, and "U" for updated files.
diff [MEDIA]
Run a recursive diff between the last committed apkovl
and the current file set.
-a
For status, compare all backup-tracked files
instead of comparing with the last committed apkovl.
-d
For commit, remove old apkovl files before writing
the new archive.
-e
Enable encryption. If no cipher is configured,
DEFAULT_CIPHER is used.
-h
Display help for the selected subcommand.
-l
For include or exclude, list entries
instead of changing them.
-n
For commit, perform a dry run and show what would
be committed.
-p PASSWORD
Use PASSWORD for encryption.
-q
Quiet mode.
-r
For include or exclude, remove files from
the selected list.
-v
Verbose mode.
Configuration is read from /etc/lbu/lbu.conf.
DEFAULT_CIPHER
Cipher used when -e enables encryption. The
default is aes-256-cbc.
ENCRYPTION
Encrypt archives with this cipher by default.
PASSWORD
Password used for encryption and decryption.
LBU_MEDIA
Default media name for commands that need backup media.
Common values are usb and floppy.
LBU_BACKUPDIR
Directory where apkovl archives are stored. When set,
lbu does not mount backup media.
BACKUP_LIMIT
Number of timestamped previous apkovl archives to keep
after commit.
Executable scripts in /etc/lbu/pre-package.d are run before
package creation. Executable scripts in /etc/lbu/post-package.d are
run after package creation.
Add files to the include list:
Exclude a file from backups:
Create an apkovl archive in the current directory:
Commit to the configured backup directory or media:
Commit to USB media and remove old apkovl files first:
Show changes compared with the last commit:
0
Success.
non-zero
An error occurred.
/etc/lbu/lbu.conf
Configuration file.
/etc/lbu/pre-package.d
Directory for scripts run before package creation.
/etc/lbu/post-package.d
Directory for scripts run after package creation.
/etc/apk/protected_paths.d/lbu.list
Include and exclude list maintained by lbu.
/media/MEDIA/HOSTNAME.apkovl.tar.gz
Default archive path when committing to media.
apk(8), setup-alpine(8), setup-disk(8),
setup-lbu(8)
Natanael Copa <ncopa@alpinelinux.org> and others