Package: zensols.rbak
Mount file systems and backup directories.This program copiessourcepaths optionally mountabletargets.  You can
configure whether or not a target is mountable or not.  If it is, the program
mounts the file system by looking for ainfo.conffile and mounts if the file
is not found.  The program only looks to see if this file exists and does not
do anything with the contents.Features:Mounts file systems only when necessaryUnmounts only file systems mountedCustomizable rsync (and mount/umount) commands.Easy/intuitive configuration.Need not bersync, you can customize the backup to whatever you want.Table of ContentsUsageConfigurationHelpObtainingChangelogLicenseUsageInstallthe library, which also installs the command.Create a configuration file (default is/etc/rbak.confif-cis not
given): See thetest case configuration filefor an example.Check your configuration:$ rbak infoBackup using a dry run (i.e. careful withrsync's--delete):$ rbak --dryrun backupStart the backup:$ rbak backupConfigurationSee thetest case configuration file, which has the explains each line of
configuration in detail.Here's a sample:## default section has configuration shared with all targets and sources[default]# name of file to look for in targets to determine if mountedinfo_file=info.conf# default name of backup directory for each target--this gets appended to the# target's pathbackup_dir=bak# commands for mounting, un-mounting and backing upmount_cmd=/bin/mount -L {name} {path}umount_cmd=/bin/umount {path}backup_cmd=rsync -rltpgoDuv --delete {source.path}/ {target.backup_path}/{source.basename}# list of targets and sources, each of which need their own sectionstargets=extbak2tsources=git## target `extbak2t` is an example of a mountable file system (i.e. USB drive)[extbak2t]# declare this to be a mountable file systemmountable=true# path resolves to /mnt/extbak2t ({name} is the target/section name)path=/mnt/{name}## the one and only source for this configuration[git]# path of where files will be copied frompath=/opt/var/git# override the basenme target backup directorybasename_dir=other/gitpathThebackup_cmdneed not be anrsynccommand, it can be anything
and you can use any property of the source and target that are generated at
runtime, but it can also by any property of these classes.The globaldefaultsection'sbackup_dirvariable is shared with all targets
and sources.  This variable is appended to the target's path so the program can
differentiate between the mount point and the path to back up files.Thebasename_dirproperty in sources overrides thesource.basenmeproperty
inbackup_cmd.  If this is not given it defaults to the basename of the
source'spathproperty.This program was written KISS (keep it simple) philosophy.  If you have a
transitive backup situation (i.e. backup A -> B, then B -> C), it's better to
break this out into two separate configuration files and two separate backup
invocations.  That said, in some cases you may be able to utilize the--sourcesoption to set which sources to backup.HelpThe usage is given with-h:$rbak-hUsage:rbak<list|...>[options]Options:--version             show program's version number and exit-h,--help            show this help message and exit-s,--short           short output for list-wNUMBER,--whine=NUMBERaddverbositytologging-cFILE,--config=FILEconfigurationfileUsage:rbakbackup[additionaloptions]RunthebackupOptions:-d,--dryrun   dry run to not actually connect, but act like it-n,--sources  override the sources property in the config-h,--help     show this help message and exitUsage:rbakmount[additionaloptions]MountalltargetsOptions:-d,--dryrun  dry run to not actually connect, but act like it-h,--help    show this help message and exitUsage:rbakumount[additionaloptions]Un-mountalltargetsOptions:-d,--dryrun  dry run to not actually connect, but act like it-h,--help    show this help message and exitObtainingThe easist way to install the command line program is via thepipinstaller:pipinstallzensols.rbakBinaries are also available onpypi.ChangelogAn extensive changelog is availablehere.LicenseCopyright (c) 2018 Paul LandesPermission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.