Package: rsbackup
rsbackupA simple rsync-based backup solution for unix systems.rsbackupis a simple python application that usesrsyncto create backups with support for hard links on
incremental backups.Installationrsbackuprequires a working installation of Python 3.10 and thersynccommand line tool.rsbackupuses onlyrsyncflags
supported on both Linux and BSD versions (i.e. MacOS) ofrsync.Use the following command to installrsbackup:pipinstallrsbackupUsagersbackupreads backup configurations from a configurationTOMLfile. The default
filename to read is$HOME/.config/rsbackup.tomlbut you can specify a different file using the-ccli
switch.The config file contains multiple backup configurations. It looks something like this[projects]description='All dev projects'source='/home/user/projects'target='/mnt/backup'excludes=['__pycache__/',]Seersbackup.tomlfor a documented example.Each TOMLtable(i.e. each section header) defines a single backup configuration. The header contains
the config's name. This is used as a command line argument to create a backup so pick something that needs no
shell escaping.Each table contains the following keys:KeyTypeOptionalDescriptiondescriptionstringyescontains an optional description.sourcesarray of stringnolists the source directories to create a backup oftargetstringnocontains a target directory which will eventualy contain multiple backupsexcludesarray of stringsyeslists patterns to be excluded from the backup. See thersyncdocumentation for a description of the pattern format.You can usersbackuplistto get a list of all backup configurations.To create a backup, runrsbackupcreate<nameoftheconfig>This will create a new directory named after the timestamp (in seconds) inside the target to contain the
backup.If you runrsbackup createwith the testconfiguration provided inrsbackup.tomlyou
will get the following backup undertmp:tmp
├── 2022-05-19_15-08-25
│   └── rsbackup
│       ├── config.py
│       ├── config_test.py
│       ├── __init__.py
│       ├── __main__.py
│       ├── rsbackup_test.py
│       ├── rsync.py
│       └── rsync_test.py
└── _latest -> /home/alex/Development/python/backup/tmp/2022-05-19_15-08-25Of course, the name of the backup directory will depend on the local time you execute the backup. Notice that
no__pycache__directory is contained in the backup as it is excluded.rsbackupprovides the following command line optionsOptionDefault ValueDescription-h,--help-display a help message-c CONFIG_FILE,--config-file CONFIG_FILE$HOME/.config/rsbackup.yamlpath of the config file-m,--dry-run-enable dry run; do not touch any files but output commands instead--no-link-latest-skip linking unchanged files to latest copy (if exists)DevelopmentYou need Python >= 3.9 to run and thus develop.tomliis used to load TOML files.pytestis used to
execute unit and acceptance tests.setuptoolsis used as aPEP517build backend.requirements.txtonly contains the minimal set of dependencies to install the application, so it only
containstomli.LicenseCopyright 2022, 2023 Alexander Metzner.Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.