package mainSzbck wraps the system's rsync utility to create time machine like backups. It is driven by a backup configuration file which identifies the root directory to backup, a target directory to store snapshots, as well as enabling and disabling various rsync options, defines the default permissions for the root of each backup (snapshot) and lists items to exclude from backup and restores.
It can be used to backup a single machine and/or to keep several machines in sync. The utility defines several subcommands implementing the various backup functions as follows:
SubCommand Description
========== =============================================================
Help Displays help on the utility and all of the subcommands.
Create Creates a backup configuration file.
Snapshot Creates a new backup snapshot hard linking unchanged items to
previous snapshots. It will implement a retention policy if
and only if the --trim option is provided.
Restore Restores/removes/replaces files in the source directory
identified by the backup configuration file honoring all
exclusions identified by the config file from a backup
snapshot. The backup snapshot need not be from the same machine
enabling syncing between machines.
Prune Removes oldest backup snapshots. NOTE: This does not
implement a retention policy but simply purges the
specified number of the oldest snapshots. A retention
policy has not yet been implemented.
Trim Manually implements the retention policy as specified in the
configuration file. Can be invoked by using the --trim option
on the snapshot subcommand.
Status Reports on the number of backup snapshots and the space used
overall and by each snapshot.
Vet Parses a backup configuration file identifying any errors
or problems without making any attempts at any operations.
Examples:
// Display help on the utility and all sub commands.
szbck help
// Creates a new backup configuration file.
szbck create -o config.szb -t backupTo /home/myDirectory
// Create a new snapshot.
szbck snapshot config.szb
// Restore updated/missing files and purge extra files (unless the --keep
// option is specified).
szbck restore config.szb
// Purge the oldest 5 snapshots from a backup set.
szbck prune -n 5 config.szb
// Vet changes made to a config.szb file.
szbck vet config.szb
This project is dedicated to Reem. Your brilliance, courage, and quiet strength continue to inspire me. Every line is written in gratitude for the light and hope you brought into my life.
NOTE: Documentation reviewed and polished with the assistance of ChatGPT from OpenAI.