NAME

yakup - backup and restore files to fixed disk and CD/DVD media

SYNOPSIS

yakup [OPTIONS] [FILES]

DESCRIPTION

yakup is yet another backup script:

COMMAND OPTIONS

yakup can execute the following commands:

-a, —archive

Create a new archive. FILES specifies the files and/or directories to archive. If no FILES are specified then files specified in INCLUDED_FILE. See ARCHIVES and ARCHIVE FILE SELECTION below.

-b, —burn

Burn an archive to removable media. If combined with the archive command then burn the newly created archive else burn archive chunk FILES specified in the command-line arguments. Rewritable media is blanked prior to writing.

-r, —restore

Restore an archive. Restore from archive chunk FILES (in argument order), if no command-line FILES are specified then restore from removable media. If combined with the burn command then the archive is recovered from removable media. Files are restored to RESTORE_DIR directory (see —restore-dir option) or to the current directory if RESTORE_DIR is not set. See ARCHIVES and ARCHIVE FILE SELECTION below.

-t, —toc

Write the list of archived file names (one per line) to a file. The table of contents is extracted from archive chunk FILES (in argument order), if no command-line FILES are specified then read archive chunks from removable media. If combined with the burn command then the table of contents is recovered from removable media. The table of contents file is written to ARCHIVE_DIR directory (see —archive-dir option and ARCHIVES below).

Commands can be combined but they will be executed in the following order: archive, burn, restore,toc — regardless of the order they appear in the command-line.

OTHER OPTIONS

-A, —archive-dir=ARCHIVE_DIR

Archive chunks, table of contents, and backup level files are written to this directory. Each backup regime should have it's own archive directory. Applies to archive and toc commands.

—cdrecord-opts=CDRECORD_OPTS

Additional cdrecord(1) options. Applies to burn command.

—dev=DEV

Media device name. Applies to burn command.

—disk1-prompt

Prompt for the first disk in archive backup set (the user is always prompted for second and subsequent disks). If a yakup command ascertains the archive has more than one chunk then this option is enabled for all subsequent commands. Applies to burn, restore, toc commands.

—dump-conf

Dump the accumulated hardwired, configuration file and command-line program parameters then exit. Useful for debugging.

-f, —conf-file=CONF_FILE

Read CONF_FILE configuration file. This option is processed first. Applies to all commands.

-h, —help

Print command-line syntax and program options to stdout.

-i, —include=PATTERN

Only extract archive file or directory names matching PATTERN. Applies to restore and toc commands.

-I, —include-file=INCLUDE_FILE

Files to include are specified in a tar include INCLUDE_FILE (see tar(1) —files-from option). See ARCHIVE FILE SELECTION below. Applies to archive command.

-l, —level=LEVEL

Sets backup level (0..9). See BACKUP LEVELS below. Applies to archive command.

—lock-tray

Don't automatically eject the media on disk change or at burn completion. This option is useful for computer enclosures with front closing doors.

—log-file=LOG_FILE

Write messages to LOG_FILE. If LOG_FILE is empty then don't write log messages. If LOG_FILE=syslog then log to syslog(3). Applies to all commands.

-m, —media=MEDIA

dvd, cdr, cdrw. Applies to burn, restore, toc commands.

—media-dir=MEDIA_DIR

Media mount directory. Must coincide with a media mount point defined in fstab(5). See yakup.conf(5). Applies to burn, restore, toc commands.

—mkisofs-opts=MKISOFS_OPTS

mkisofs(8) options. Applies to burn command.

-n, —dry-run

Don't do anything just print what would have been done. Bear in mind that because commands are not actually executed subsequent dependent commands don't always generate the expected output. Maximum verbosity to console but does generate create log file entries. Applies to all commands.

-o, —one-file-system

Don't cross file system boundaries when creating an archive. Applies to archive command.

-p, —prefix=PREFIX

Sets the file name prefix for archive chunks and table of contents files. %l in PREFIX is replaced by LEVEL. Defaults to yakup%l.yyyymmdd. Applies to archive command.

-R, —restore-dir=RESTORE_DIR

Directory to restore to. Applies to restore and toc commands.

-s, —chunk-size=CHUNK_SIZE

Set size of archive chunks. Size can be specified in bytes, kilobytes (K suffix), megabytes (M suffix), gigabytes (G suffix). Decimal fractions allowed. The default size for each media type can be set in a configuration file (see yakup.conf(5)). Applies to archive command.

—tar-opts=TAR_OPTS

Additional tar(1) options. Applies archive, restore, toc commands.

-u, —unattended

If more than one disk is required to burn archive or user intervention is required to mount removable media then an error exit occurs. Applies to burn, restore, toc commands.

-v, —verbose

Print operational details to stderr. A second -v options will print additional diagnostic information to stderr. Applies to all commands.

—version

Print yakup version to stdout.

—volume-id=VOLUME_ID

Set media volume ID. %l in VOLUME_ID is replaced by LEVEL. %n in VOLUME_ID is replaced by current disk number. %N in VOLUME_ID is replaced by total number of disks. Defaults to yakup%l yyyy-mm-dd (%n of %N). Applies to burn command.

-X, —exclude-file=EXCLUDE_FILE

Files to exclude are specified in a tar exclude EXCLUDE_FILE (see tar(1) —exclude-file option). If EXCLUDE_FILE is set to an empty string file exclusion is disabled. See ARCHIVE FILE SELECTION below. Applies to archive command.

-z, —compression=COMPRESSION

Set archive compression: gzip or bzip2. Applies to archive, restore, toc commands.

OPTION VALUES

When yakup(1) starts program option values are accumulated from the following sources in the following order:

  1. Internally defined values hardwired into the yakup script.

  2. The optional global /etc/yakup/yakup.conf configuration file.

  3. The optional user $HOME/.yakup/yakup.conf configuration file.

  4. Configuration files specified by the —conf-file command-line option.

  5. Command-line options.

See also yakup.conf(5).

ARCHIVES

A yackup archive is a tar archive (optionally compressed) that has been split into one or more files (chunks).

Archives are written to the ARCHIVE_DIR directory, so the containing file system must have enough free space for the complete archive.

Archives are split into chunks as they are written (see —chunk-size option).

Each chunk is named like: <prefix>[_last].tar[.<compression>].<chunk>

Examples:

yakup0.20050819.tar.gz.000
yakup0.20050819_last.tar.gz.001

If the —burn command option is specified the archive is written (one chunk per disk) to the designated removable media.

Archive Table of Contents

An archive table of contents is a text file, generated by the —toc command, containing the names (one per line) of the files and directories stored in an archive:

BACKUP LEVELS

Backup levels facilitate multi-level differential backups.

For example after completing a level 0 backup a backup level file named yakup.level.0 is created in the ARCHIVE_DIR, it's modification time is set to the time the level 0 backup began, subsequent level 1 backups only backup changes since the yakup.level.0 file's modification time.

ARCHIVE FILE SELECTION

Exclusion Patterns

During archive creation tar(1) recursively traverses included directories matching file system paths against exclusion patterns. A match occurs if an exclusion pattern matches the file system path or any sub-path.

For example, archiving /, the file /home/me/project/abc.txt will be excluded if one or more exclusion patterns matches any of the files sub-paths:

home
me
home/me
project
me/project
home/me/project
abc.txt
project/abc.txt
me/project/abc.txt
home/me/project/abc.txt

See also the GNU tar(1) documentation.

PREREQUISITES

yakup(1) uses the following programs, all of which normally come standard with modern UNIX distributions:

EXAMPLES

FILES

/etc/yakup/yakup.conf

Optional global configuration file (see yakup.conf(5)).

$HOME/.yakup/yakup.conf

Optional user configuration file (see yakup.conf(5)).

/tmp/yakup.<pid>.fifo

Fifo created during media based restore and toc command execution. <pid> is the yakup(1) instance process ID.

See also BACKUP LEVELS and ARCHIVE FILES above.

BUGS

Please report any bugs to the author.

AUTHOR

Written by Stuart Rackham <srackham@methods.co.nz>.

SEE ALSO

yakup.conf(5), tar(1), mkisofs(8), cdrecord(1), growisofs(1).

COPYING

Copyright (C) 2005-2006 Stuart Rackham. Free use of this software is granted under the terms of the GNU General Public License (GPL).