Simplified compressed archive management.
- Minimal CLI options/arguments are required for basic backup operations.
- Automatically generated archive names based on the working folder and time.
- Use faster compression programs and multiple cores, when available.
- Save location-specific options as tzar aliases.
- Full command line help using the
help
sub-command.
For simplicity, tzar
does not normally need to have a source file/folder
specified. By default it operates on the working folder, but can also be pointed
at anything from anywhere. Options are also available to exclude files and
folders. Complex option sets can be saved as aliases.
Also for simplicity, Tzar defaults to automatically naming saved archives using
the source folder name and a timestamp. It place archives in a ../tzarchive
folder relative to the source location. It uses standard compressed archive
naming conventions for the file extensions.
For example, the tzar save
command creates a timestamped gzip
archive of the
working folder in ../tzarchive
. To use xz
compression instead of gzip
, add
the -m xz
option.
Target archive names use the source name plus a suffix. The default suffix
format can be overridden with a template that accepts normal characters and
time.strftime()
format codes for date/time-based names.
The suffix also supports converting an ending '#' character to a unique counter to avoid base file name collisions.
Please note that the '#' character only has special meaning as the last
character, and only has an effect when date/time %
codes are not being used
for unique name generation.
"$NAME" environment variables are expanded in the final output path.
The commands below are commonly used. Please browse the tzar
command line help
system for more information about available sub-commands.
tzar help
ortzar help COMMAND ...
provides top level or sub-command help.tzar save
creates a timestampedgzip
archive of the working folder in../tzarchive
.tzar save -m zip
andtzar save -m xz
archives the working folder usingzip
orxz
compression.tzar save -m files
usesrsync
to copy files into a../tzarchive
sub-folder.tzar catalog
lists timestamps of existing archives of the working folder.tzar catalog -l
lists timestamps and file names of existing archives of the working folder.tzar delete
andtzar prune
support clearing out excess saved archives.
For now tzar
has no configuration file. The Jiig core supports aliases that
allow operations and options to be captured and used. Aliases can be scoped to
particular locations, but can also apply globally.
The example below demonstrates alias creation with different options for different locations. Each location has its own compression method and exclusions. But the alias name represents a single logical command.
$ cd /my/project1
$ tzar alias set .bkp save -m gz -e __cache__
$ cd /my/project2
$ tzar alias set .bkp save -m zip -e dist -e build
The example below demonstrates using a named alias with per-location customizations. It is based on the creation example above.
$ cd /my/project1
$ tzar .bkp
$ cd /my/project2
$ tzar .bkp
The following examples place Tzar and Jiig under /usr/local
and create
symlinks in /usr/local/bin
, assuming that folder is in the shell execution
path.
Alternatively, you can place Tzar and Jiig under your home folder and create
symlinks in ~/bin
, assuming it is in your shell execution path.
Jiig is a framework for building multi-command CLI tools. Tzar uses Jiig to implement command line parsing, task execution, and alias management.
$ cd /usr/local
$ git clone https://github.com/wijjo/jiig.git
$ ln -s /usr/local/jiig/bin/jiig /usr/local/bin
$ cd /usr/local
$ git clone https://github.com/wijjo/tzar.git
$ ln -s /usr/local/tzar/bin/tzar /usr/local/bin
Run the tzar
command. The first run builds a virtual environment. At this
point it's ready to use.