dar-backup 0.6.18__tar.gz → 0.6.19__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dar_backup-0.6.18 → dar_backup-0.6.19}/.gitignore +1 -1
- {dar_backup-0.6.18/src/dar_backup → dar_backup-0.6.19}/Changelog.md +15 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/PKG-INFO +51 -15
- {dar_backup-0.6.18 → dar_backup-0.6.19}/README.md +49 -14
- {dar_backup-0.6.18 → dar_backup-0.6.19}/doc/dev.md +4 -4
- {dar_backup-0.6.18 → dar_backup-0.6.19}/pyproject.toml +1 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19/src/dar_backup}/Changelog.md +15 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/README.md +49 -14
- dar_backup-0.6.19/src/dar_backup/__about__.py +1 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/clean_log.py +14 -7
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/cleanup.py +7 -2
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/command_runner.py +59 -9
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/dar_backup.py +21 -6
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/manager.py +162 -65
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/util.py +247 -2
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/DataProperty-1.1.0.dist-info/LICENSE +21 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/chardet-5.2.0.dist-info/LICENSE +502 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/mbstrdecoder-1.1.4.dist-info/LICENSE +21 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/pathvalidate-3.2.3.dist-info/LICENSE +21 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/prettytable-3.16.0.dist-info/licenses/LICENSE +30 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/pytablewriter-1.2.1.dist-info/LICENSE +21 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/pytest_timeout-2.3.1.dist-info/LICENSE +22 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/python_dateutil-2.9.0.post0.dist-info/LICENSE +54 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/python_slugify-8.0.4.dist-info/LICENSE +21 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/LICENSE +166 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/backports.tarfile-1.2.0.dist-info/LICENSE +17 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/importlib_metadata-8.0.0.dist-info/LICENSE +202 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/inflect-7.3.1.dist-info/LICENSE +17 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/jaraco.collections-5.1.0.dist-info/LICENSE +17 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/jaraco.context-5.3.0.dist-info/LICENSE +17 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/LICENSE +17 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/jaraco.text-3.12.1.dist-info/LICENSE +17 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/LICENSE +19 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/packaging-24.2.dist-info/LICENSE +3 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/platformdirs-4.2.2.dist-info/licenses/LICENSE +21 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/LICENSE +19 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/typing_extensions-4.12.2.dist-info/LICENSE +279 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/wheel/vendored/packaging/LICENSE +3 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/zipp-3.19.2.dist-info/LICENSE +17 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/six-1.17.0.dist-info/LICENSE +18 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/tabledata-1.3.4.dist-info/LICENSE +21 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/tcolorpy-0.1.7.dist-info/LICENSE +21 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/tomli_w-1.0.0.dist-info/LICENSE +21 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/typepy-1.3.4.dist-info/LICENSE +21 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/wcwidth-0.2.13.dist-info/LICENSE +27 -0
- dar_backup-0.6.19/venv/lib/python3.12/site-packages/zipp-3.19.2.dist-info/LICENSE +17 -0
- dar_backup-0.6.18/src/dar_backup/__about__.py +0 -1
- dar_backup-0.6.18/venv/lib/python3.12/site-packages/dar_backup/Changelog.md +0 -214
- dar_backup-0.6.18/venv/lib/python3.12/site-packages/dar_backup/README.md +0 -1082
- {dar_backup-0.6.18 → dar_backup-0.6.19}/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/doc/doc.md +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/.darrc +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/__init__.py +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/config_settings.py +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/dar-backup.conf +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/dar_backup_systemd.py +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/installer.py +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/src/dar_backup/rich_progress.py +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/SecretStorage-3.3.3.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/anyio-4.4.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/build-1.2.1.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/certifi-2024.7.4.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/cffi-1.16.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/charset_normalizer-3.3.2.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/cryptography-43.0.0.dist-info/license_files/LICENSE +0 -0
- {dar_backup-0.6.18/venv/lib/python3.12/site-packages/dar_backup-0.6.18.dist-info → dar_backup-0.6.19/venv/lib/python3.12/site-packages/dar_backup-0.6.19.dist-info}/licenses/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/filelock-3.15.4.dist-info/licenses/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/hyperlink-21.0.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/importlib_metadata-8.2.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/iniconfig-2.0.0.dist-info/licenses/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/jaraco.classes-3.4.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/jaraco.context-5.3.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/jaraco.functools-4.0.2.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/jeepney-0.8.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/keyring-25.3.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/markdown_it_py-3.0.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/more_itertools-10.3.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/packaging-24.1.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/pathspec-0.12.1.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/pexpect-4.9.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/platformdirs-4.2.2.dist-info/licenses/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/pluggy-1.5.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/psutil-7.0.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/ptyprocess-0.7.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/pycparser-2.22.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/pygments-2.19.1.dist-info/licenses/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/pytest-8.3.2.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/pytest_cov-6.0.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/readme_renderer-44.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/requests-2.32.3.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/requests_toolbelt-1.0.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/rfc3986-2.0.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/rich-14.0.0.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18/venv/lib/python3.12/site-packages/tomli_w-1.0.0.dist-info → dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info}/LICENSE +0 -0
- {dar_backup-0.6.18/venv/lib/python3.12/site-packages/zipp-3.19.2.dist-info → dar_backup-0.6.19/venv/lib/python3.12/site-packages/setuptools-78.1.0.dist-info/licenses}/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/shellingham-1.5.4.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/sniffio-1.3.1.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/tomlkit-0.13.2.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/trove_classifiers-2024.7.2.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/twine-6.0.1.dist-info/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/virtualenv-20.26.3.dist-info/licenses/LICENSE +0 -0
- {dar_backup-0.6.18 → dar_backup-0.6.19}/venv/lib/python3.12/site-packages/zstandard-0.23.0.dist-info/LICENSE +0 -0
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
<!-- markdownlint-disable MD024 -->
|
|
2
2
|
# dar-backup Changelog
|
|
3
3
|
|
|
4
|
+
## v2-beta-0.6.19 - 2025-04-21
|
|
5
|
+
|
|
6
|
+
Github link: [v2-beta-0.6.19](https://github.com/per2jensen/dar-backup/tree/v2-beta-0.6.19/v2)
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- removed a BackupError in the verify() to reduce noise in logs and let the rest of "compares" run.
|
|
11
|
+
- Added bash and zsh auto completion for a nicer CLI experience.
|
|
12
|
+
|
|
13
|
+
-- See [README for details](https://github.com/per2jensen/dar-backup?tab=readme-ov-file#shell-autocompletion)
|
|
14
|
+
|
|
15
|
+
- Improvement to command_runner.run(), more robust decoding
|
|
16
|
+
|
|
17
|
+
- Manager --add-specific-archive now gives a prompt with a warning if user attempts to add a catalog that breaks chronology. The user is allowed to go forward and ignore the warning or can choose to abort. The program times out after a little while and discards the operation.
|
|
18
|
+
|
|
4
19
|
## v2-beta-0.6.18 - 2025-04-05
|
|
5
20
|
|
|
6
21
|
Github link: [v2-beta-0.6.18](https://github.com/per2jensen/dar-backup/tree/v2-beta-0.6.18/v2)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dar-backup
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.19
|
|
4
4
|
Summary: A script to do full, differential and incremental backups using dar. Some files are restored from the backups during verification, after which par2 redundancy files are created. The script also has a cleanup feature to remove old backups and par2 files.
|
|
5
5
|
Project-URL: GPG Public Key, https://keys.openpgp.org/search?q=dar-backup@pm.me
|
|
6
6
|
Project-URL: Homepage, https://github.com/per2jensen/dar-backup/tree/main/v2
|
|
@@ -689,6 +689,7 @@ Classifier: Operating System :: POSIX :: Linux
|
|
|
689
689
|
Classifier: Programming Language :: Python :: 3.9
|
|
690
690
|
Classifier: Topic :: System :: Archiving :: Backup
|
|
691
691
|
Requires-Python: >=3.9
|
|
692
|
+
Requires-Dist: argcomplete>=3.6.2
|
|
692
693
|
Requires-Dist: inputimeout>=1.0.4
|
|
693
694
|
Requires-Dist: rich>=13.0.0
|
|
694
695
|
Description-Content-Type: text/markdown
|
|
@@ -697,12 +698,18 @@ Description-Content-Type: text/markdown
|
|
|
697
698
|
# Full, differential or incremental backups using 'dar'
|
|
698
699
|
|
|
699
700
|
[](https://codecov.io/gh/per2jensen/dar-backup)
|
|
701
|
+
[](https://pypi.org/project/dar-backup/)
|
|
702
|
+
[](https://pypi.org/project/dar-backup/)
|
|
700
703
|
|
|
701
704
|
The wonderful 'dar' [Disk Archiver](https://github.com/Edrusb/DAR) is used for
|
|
702
705
|
the heavy lifting, together with the par2 suite in these scripts.
|
|
703
706
|
|
|
704
707
|
This is the `Python` based **version 2** of `dar-backup`.
|
|
705
708
|
|
|
709
|
+
## TL;DR
|
|
710
|
+
|
|
711
|
+
`dar-backup` is a Python-powered CLI for creating and validating full, differential, and incremental backups using dar and par2. Designed for long-term restore integrity, even on user-space filesystems like FUSE.
|
|
712
|
+
|
|
706
713
|
## Table of Contents
|
|
707
714
|
|
|
708
715
|
- [Full, differential or incremental backups using 'dar'](#full-differential-or-incremental-backups-using-dar)
|
|
@@ -728,6 +735,7 @@ This is the `Python` based **version 2** of `dar-backup`.
|
|
|
728
735
|
- [Generate systemd files](#generate-systemd-files)
|
|
729
736
|
- [Service: dar-back --incremental-backup](#service-dar-backup---incremental-backup)
|
|
730
737
|
- [Timer: dar-back --incremental-backup](#timer-dar-backup---incremental-backup)
|
|
738
|
+
- [Systemd timer note](#systemd-timer-note)
|
|
731
739
|
- [List contents of an archive](#list-contents-of-an-archive)
|
|
732
740
|
- [dar file selection examples](#dar-file-selection-examples)
|
|
733
741
|
- [Select a directory](#select-a-directory)
|
|
@@ -753,7 +761,9 @@ This is the `Python` based **version 2** of `dar-backup`.
|
|
|
753
761
|
- [Skipping cache directories](#skipping-cache-directories)
|
|
754
762
|
- [Progress bar + current directory](#progress-bar-and-current-directory)
|
|
755
763
|
- [Todo](#todo)
|
|
764
|
+
- [Known Limitations / Edge Cases](#known-limitations--edge-cases)
|
|
756
765
|
- [Reference](#reference)
|
|
766
|
+
- [CLI Tools Overview](#cli-tools-overview)
|
|
757
767
|
- [Test coverage report](#test-coverage)
|
|
758
768
|
- [dar-backup](#dar-backup-options)
|
|
759
769
|
- [manager](#manager-options)
|
|
@@ -1346,6 +1356,10 @@ Persistent=true
|
|
|
1346
1356
|
WantedBy=timers.target
|
|
1347
1357
|
````
|
|
1348
1358
|
|
|
1359
|
+
## systemd timer note
|
|
1360
|
+
|
|
1361
|
+
📅 OnCalendar syntax is flexible — you can tweak backup schedules easily. Run systemd-analyze calendar to preview timers.
|
|
1362
|
+
|
|
1349
1363
|
## list contents of an archive
|
|
1350
1364
|
|
|
1351
1365
|
```` bash
|
|
@@ -1636,8 +1650,27 @@ The indicators are not shown if dar-backup is run from systemd or if it is used
|
|
|
1636
1650
|
- Look into a way to move the .par2 files away from the `dar` slices, to maximize chance of good redundancy.
|
|
1637
1651
|
- Add option to dar-backup to use the `dar` option `--fsa-scope none`
|
|
1638
1652
|
|
|
1653
|
+
## Known Limitations / Edge Cases
|
|
1654
|
+
|
|
1655
|
+
Does not currently encrypt data (by design — relies on encrypted storage)
|
|
1656
|
+
|
|
1657
|
+
One backup definition per file
|
|
1658
|
+
|
|
1659
|
+
.par2 files created for each slice (may be moved in future)
|
|
1660
|
+
|
|
1639
1661
|
## Reference
|
|
1640
1662
|
|
|
1663
|
+
### CLI Tools Overview
|
|
1664
|
+
|
|
1665
|
+
| Command | Description |
|
|
1666
|
+
|-----------------------|-------------------------------------------|
|
|
1667
|
+
| `dar-backup` | Perform full, differential, or incremental backups with verification and restore testing |
|
|
1668
|
+
| `manager` | Maintain and query catalog databases for archives |
|
|
1669
|
+
| `cleanup` | Remove outdated DIFF/INCR archives (and optionally FULLs) |
|
|
1670
|
+
| `clean-log` | Clean up excessive log output from dar command logs |
|
|
1671
|
+
| `installer` | Set up required directories and default config files |
|
|
1672
|
+
| `dar-backup-systemd` | Generate (and optionally install) systemd timers and services for automated backups |
|
|
1673
|
+
|
|
1641
1674
|
### test coverage
|
|
1642
1675
|
|
|
1643
1676
|
Running
|
|
@@ -1646,23 +1679,26 @@ Running
|
|
|
1646
1679
|
pytest --cov=dar_backup tests/
|
|
1647
1680
|
````
|
|
1648
1681
|
|
|
1649
|
-
results for version 0.6.
|
|
1682
|
+
results for a dev version 0.6.19 in this report:
|
|
1650
1683
|
|
|
1651
1684
|
```` code
|
|
1652
1685
|
---------- coverage: platform linux, python 3.12.3-final-0 -----------
|
|
1653
|
-
Name
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1686
|
+
Name Stmts Miss Cover
|
|
1687
|
+
----------------------------------------------------------
|
|
1688
|
+
src/dar_backup/__about__.py 1 0 100%
|
|
1689
|
+
src/dar_backup/__init__.py 0 0 100%
|
|
1690
|
+
src/dar_backup/clean_log.py 68 13 81%
|
|
1691
|
+
src/dar_backup/cleanup.py 193 17 91%
|
|
1692
|
+
src/dar_backup/command_runner.py 73 1 99%
|
|
1693
|
+
src/dar_backup/config_settings.py 66 8 88%
|
|
1694
|
+
src/dar_backup/dar_backup.py 535 56 90%
|
|
1695
|
+
src/dar_backup/dar_backup_systemd.py 56 7 88%
|
|
1696
|
+
src/dar_backup/installer.py 59 6 90%
|
|
1697
|
+
src/dar_backup/manager.py 351 56 84%
|
|
1698
|
+
src/dar_backup/rich_progress.py 70 7 90%
|
|
1699
|
+
src/dar_backup/util.py 130 15 88%
|
|
1700
|
+
----------------------------------------------------------
|
|
1701
|
+
TOTAL 1602 186 88%
|
|
1666
1702
|
````
|
|
1667
1703
|
|
|
1668
1704
|
### dar-backup options
|
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
# Full, differential or incremental backups using 'dar'
|
|
3
3
|
|
|
4
4
|
[](https://codecov.io/gh/per2jensen/dar-backup)
|
|
5
|
+
[](https://pypi.org/project/dar-backup/)
|
|
6
|
+
[](https://pypi.org/project/dar-backup/)
|
|
5
7
|
|
|
6
8
|
The wonderful 'dar' [Disk Archiver](https://github.com/Edrusb/DAR) is used for
|
|
7
9
|
the heavy lifting, together with the par2 suite in these scripts.
|
|
8
10
|
|
|
9
11
|
This is the `Python` based **version 2** of `dar-backup`.
|
|
10
12
|
|
|
13
|
+
## TL;DR
|
|
14
|
+
|
|
15
|
+
`dar-backup` is a Python-powered CLI for creating and validating full, differential, and incremental backups using dar and par2. Designed for long-term restore integrity, even on user-space filesystems like FUSE.
|
|
16
|
+
|
|
11
17
|
## Table of Contents
|
|
12
18
|
|
|
13
19
|
- [Full, differential or incremental backups using 'dar'](#full-differential-or-incremental-backups-using-dar)
|
|
@@ -33,6 +39,7 @@ This is the `Python` based **version 2** of `dar-backup`.
|
|
|
33
39
|
- [Generate systemd files](#generate-systemd-files)
|
|
34
40
|
- [Service: dar-back --incremental-backup](#service-dar-backup---incremental-backup)
|
|
35
41
|
- [Timer: dar-back --incremental-backup](#timer-dar-backup---incremental-backup)
|
|
42
|
+
- [Systemd timer note](#systemd-timer-note)
|
|
36
43
|
- [List contents of an archive](#list-contents-of-an-archive)
|
|
37
44
|
- [dar file selection examples](#dar-file-selection-examples)
|
|
38
45
|
- [Select a directory](#select-a-directory)
|
|
@@ -58,7 +65,9 @@ This is the `Python` based **version 2** of `dar-backup`.
|
|
|
58
65
|
- [Skipping cache directories](#skipping-cache-directories)
|
|
59
66
|
- [Progress bar + current directory](#progress-bar-and-current-directory)
|
|
60
67
|
- [Todo](#todo)
|
|
68
|
+
- [Known Limitations / Edge Cases](#known-limitations--edge-cases)
|
|
61
69
|
- [Reference](#reference)
|
|
70
|
+
- [CLI Tools Overview](#cli-tools-overview)
|
|
62
71
|
- [Test coverage report](#test-coverage)
|
|
63
72
|
- [dar-backup](#dar-backup-options)
|
|
64
73
|
- [manager](#manager-options)
|
|
@@ -651,6 +660,10 @@ Persistent=true
|
|
|
651
660
|
WantedBy=timers.target
|
|
652
661
|
````
|
|
653
662
|
|
|
663
|
+
## systemd timer note
|
|
664
|
+
|
|
665
|
+
📅 OnCalendar syntax is flexible — you can tweak backup schedules easily. Run systemd-analyze calendar to preview timers.
|
|
666
|
+
|
|
654
667
|
## list contents of an archive
|
|
655
668
|
|
|
656
669
|
```` bash
|
|
@@ -941,8 +954,27 @@ The indicators are not shown if dar-backup is run from systemd or if it is used
|
|
|
941
954
|
- Look into a way to move the .par2 files away from the `dar` slices, to maximize chance of good redundancy.
|
|
942
955
|
- Add option to dar-backup to use the `dar` option `--fsa-scope none`
|
|
943
956
|
|
|
957
|
+
## Known Limitations / Edge Cases
|
|
958
|
+
|
|
959
|
+
Does not currently encrypt data (by design — relies on encrypted storage)
|
|
960
|
+
|
|
961
|
+
One backup definition per file
|
|
962
|
+
|
|
963
|
+
.par2 files created for each slice (may be moved in future)
|
|
964
|
+
|
|
944
965
|
## Reference
|
|
945
966
|
|
|
967
|
+
### CLI Tools Overview
|
|
968
|
+
|
|
969
|
+
| Command | Description |
|
|
970
|
+
|-----------------------|-------------------------------------------|
|
|
971
|
+
| `dar-backup` | Perform full, differential, or incremental backups with verification and restore testing |
|
|
972
|
+
| `manager` | Maintain and query catalog databases for archives |
|
|
973
|
+
| `cleanup` | Remove outdated DIFF/INCR archives (and optionally FULLs) |
|
|
974
|
+
| `clean-log` | Clean up excessive log output from dar command logs |
|
|
975
|
+
| `installer` | Set up required directories and default config files |
|
|
976
|
+
| `dar-backup-systemd` | Generate (and optionally install) systemd timers and services for automated backups |
|
|
977
|
+
|
|
946
978
|
### test coverage
|
|
947
979
|
|
|
948
980
|
Running
|
|
@@ -951,23 +983,26 @@ Running
|
|
|
951
983
|
pytest --cov=dar_backup tests/
|
|
952
984
|
````
|
|
953
985
|
|
|
954
|
-
results for version 0.6.
|
|
986
|
+
results for a dev version 0.6.19 in this report:
|
|
955
987
|
|
|
956
988
|
```` code
|
|
957
989
|
---------- coverage: platform linux, python 3.12.3-final-0 -----------
|
|
958
|
-
Name
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
990
|
+
Name Stmts Miss Cover
|
|
991
|
+
----------------------------------------------------------
|
|
992
|
+
src/dar_backup/__about__.py 1 0 100%
|
|
993
|
+
src/dar_backup/__init__.py 0 0 100%
|
|
994
|
+
src/dar_backup/clean_log.py 68 13 81%
|
|
995
|
+
src/dar_backup/cleanup.py 193 17 91%
|
|
996
|
+
src/dar_backup/command_runner.py 73 1 99%
|
|
997
|
+
src/dar_backup/config_settings.py 66 8 88%
|
|
998
|
+
src/dar_backup/dar_backup.py 535 56 90%
|
|
999
|
+
src/dar_backup/dar_backup_systemd.py 56 7 88%
|
|
1000
|
+
src/dar_backup/installer.py 59 6 90%
|
|
1001
|
+
src/dar_backup/manager.py 351 56 84%
|
|
1002
|
+
src/dar_backup/rich_progress.py 70 7 90%
|
|
1003
|
+
src/dar_backup/util.py 130 15 88%
|
|
1004
|
+
----------------------------------------------------------
|
|
1005
|
+
TOTAL 1602 186 88%
|
|
971
1006
|
````
|
|
972
1007
|
|
|
973
1008
|
### dar-backup options
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
cd <path/to/dar-backup/v2>
|
|
7
7
|
python3 -m venv venv
|
|
8
8
|
. venv/bin/activate
|
|
9
|
-
pip install inputimeout build hatch hatchling pytest pytest-cov twine wheel psutil
|
|
9
|
+
pip install inputimeout build hatch hatchling pytest pytest-cov twine wheel psutil pytest-timeout argcomplete
|
|
10
10
|
````
|
|
11
11
|
|
|
12
12
|
## Activate the venv
|
|
@@ -32,19 +32,19 @@ A pytest.ini is located in the v2 directory, so that pytest writes out captures
|
|
|
32
32
|
That is useful when working with a single test and is the default
|
|
33
33
|
|
|
34
34
|
```` bash
|
|
35
|
-
pytest -c pytest-minimal.ini tests/test_verbose.py::test_verbose_error_reporting
|
|
35
|
+
PYTHONPATH=src pytest -c pytest-minimal.ini tests/test_verbose.py::test_verbose_error_reporting
|
|
36
36
|
````
|
|
37
37
|
|
|
38
38
|
Use to get the minimal info on successful test cases
|
|
39
39
|
|
|
40
40
|
```` bash
|
|
41
|
-
pytest -c pytest-minimal.ini
|
|
41
|
+
PYTHONPATH=src pytest -c pytest-minimal.ini
|
|
42
42
|
````
|
|
43
43
|
|
|
44
44
|
or for specific file with test cases
|
|
45
45
|
|
|
46
46
|
```` bash
|
|
47
|
-
pytest -c pytest-minimal.ini tests/test_verbose.py
|
|
47
|
+
PYTHONPATH=src pytest -c pytest-minimal.ini tests/test_verbose.py
|
|
48
48
|
````
|
|
49
49
|
|
|
50
50
|
## Upload to PyPI
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
<!-- markdownlint-disable MD024 -->
|
|
2
2
|
# dar-backup Changelog
|
|
3
3
|
|
|
4
|
+
## v2-beta-0.6.19 - 2025-04-21
|
|
5
|
+
|
|
6
|
+
Github link: [v2-beta-0.6.19](https://github.com/per2jensen/dar-backup/tree/v2-beta-0.6.19/v2)
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- removed a BackupError in the verify() to reduce noise in logs and let the rest of "compares" run.
|
|
11
|
+
- Added bash and zsh auto completion for a nicer CLI experience.
|
|
12
|
+
|
|
13
|
+
-- See [README for details](https://github.com/per2jensen/dar-backup?tab=readme-ov-file#shell-autocompletion)
|
|
14
|
+
|
|
15
|
+
- Improvement to command_runner.run(), more robust decoding
|
|
16
|
+
|
|
17
|
+
- Manager --add-specific-archive now gives a prompt with a warning if user attempts to add a catalog that breaks chronology. The user is allowed to go forward and ignore the warning or can choose to abort. The program times out after a little while and discards the operation.
|
|
18
|
+
|
|
4
19
|
## v2-beta-0.6.18 - 2025-04-05
|
|
5
20
|
|
|
6
21
|
Github link: [v2-beta-0.6.18](https://github.com/per2jensen/dar-backup/tree/v2-beta-0.6.18/v2)
|
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
# Full, differential or incremental backups using 'dar'
|
|
3
3
|
|
|
4
4
|
[](https://codecov.io/gh/per2jensen/dar-backup)
|
|
5
|
+
[](https://pypi.org/project/dar-backup/)
|
|
6
|
+
[](https://pypi.org/project/dar-backup/)
|
|
5
7
|
|
|
6
8
|
The wonderful 'dar' [Disk Archiver](https://github.com/Edrusb/DAR) is used for
|
|
7
9
|
the heavy lifting, together with the par2 suite in these scripts.
|
|
8
10
|
|
|
9
11
|
This is the `Python` based **version 2** of `dar-backup`.
|
|
10
12
|
|
|
13
|
+
## TL;DR
|
|
14
|
+
|
|
15
|
+
`dar-backup` is a Python-powered CLI for creating and validating full, differential, and incremental backups using dar and par2. Designed for long-term restore integrity, even on user-space filesystems like FUSE.
|
|
16
|
+
|
|
11
17
|
## Table of Contents
|
|
12
18
|
|
|
13
19
|
- [Full, differential or incremental backups using 'dar'](#full-differential-or-incremental-backups-using-dar)
|
|
@@ -33,6 +39,7 @@ This is the `Python` based **version 2** of `dar-backup`.
|
|
|
33
39
|
- [Generate systemd files](#generate-systemd-files)
|
|
34
40
|
- [Service: dar-back --incremental-backup](#service-dar-backup---incremental-backup)
|
|
35
41
|
- [Timer: dar-back --incremental-backup](#timer-dar-backup---incremental-backup)
|
|
42
|
+
- [Systemd timer note](#systemd-timer-note)
|
|
36
43
|
- [List contents of an archive](#list-contents-of-an-archive)
|
|
37
44
|
- [dar file selection examples](#dar-file-selection-examples)
|
|
38
45
|
- [Select a directory](#select-a-directory)
|
|
@@ -58,7 +65,9 @@ This is the `Python` based **version 2** of `dar-backup`.
|
|
|
58
65
|
- [Skipping cache directories](#skipping-cache-directories)
|
|
59
66
|
- [Progress bar + current directory](#progress-bar-and-current-directory)
|
|
60
67
|
- [Todo](#todo)
|
|
68
|
+
- [Known Limitations / Edge Cases](#known-limitations--edge-cases)
|
|
61
69
|
- [Reference](#reference)
|
|
70
|
+
- [CLI Tools Overview](#cli-tools-overview)
|
|
62
71
|
- [Test coverage report](#test-coverage)
|
|
63
72
|
- [dar-backup](#dar-backup-options)
|
|
64
73
|
- [manager](#manager-options)
|
|
@@ -651,6 +660,10 @@ Persistent=true
|
|
|
651
660
|
WantedBy=timers.target
|
|
652
661
|
````
|
|
653
662
|
|
|
663
|
+
## systemd timer note
|
|
664
|
+
|
|
665
|
+
📅 OnCalendar syntax is flexible — you can tweak backup schedules easily. Run systemd-analyze calendar to preview timers.
|
|
666
|
+
|
|
654
667
|
## list contents of an archive
|
|
655
668
|
|
|
656
669
|
```` bash
|
|
@@ -941,8 +954,27 @@ The indicators are not shown if dar-backup is run from systemd or if it is used
|
|
|
941
954
|
- Look into a way to move the .par2 files away from the `dar` slices, to maximize chance of good redundancy.
|
|
942
955
|
- Add option to dar-backup to use the `dar` option `--fsa-scope none`
|
|
943
956
|
|
|
957
|
+
## Known Limitations / Edge Cases
|
|
958
|
+
|
|
959
|
+
Does not currently encrypt data (by design — relies on encrypted storage)
|
|
960
|
+
|
|
961
|
+
One backup definition per file
|
|
962
|
+
|
|
963
|
+
.par2 files created for each slice (may be moved in future)
|
|
964
|
+
|
|
944
965
|
## Reference
|
|
945
966
|
|
|
967
|
+
### CLI Tools Overview
|
|
968
|
+
|
|
969
|
+
| Command | Description |
|
|
970
|
+
|-----------------------|-------------------------------------------|
|
|
971
|
+
| `dar-backup` | Perform full, differential, or incremental backups with verification and restore testing |
|
|
972
|
+
| `manager` | Maintain and query catalog databases for archives |
|
|
973
|
+
| `cleanup` | Remove outdated DIFF/INCR archives (and optionally FULLs) |
|
|
974
|
+
| `clean-log` | Clean up excessive log output from dar command logs |
|
|
975
|
+
| `installer` | Set up required directories and default config files |
|
|
976
|
+
| `dar-backup-systemd` | Generate (and optionally install) systemd timers and services for automated backups |
|
|
977
|
+
|
|
946
978
|
### test coverage
|
|
947
979
|
|
|
948
980
|
Running
|
|
@@ -951,23 +983,26 @@ Running
|
|
|
951
983
|
pytest --cov=dar_backup tests/
|
|
952
984
|
````
|
|
953
985
|
|
|
954
|
-
results for version 0.6.
|
|
986
|
+
results for a dev version 0.6.19 in this report:
|
|
955
987
|
|
|
956
988
|
```` code
|
|
957
989
|
---------- coverage: platform linux, python 3.12.3-final-0 -----------
|
|
958
|
-
Name
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
990
|
+
Name Stmts Miss Cover
|
|
991
|
+
----------------------------------------------------------
|
|
992
|
+
src/dar_backup/__about__.py 1 0 100%
|
|
993
|
+
src/dar_backup/__init__.py 0 0 100%
|
|
994
|
+
src/dar_backup/clean_log.py 68 13 81%
|
|
995
|
+
src/dar_backup/cleanup.py 193 17 91%
|
|
996
|
+
src/dar_backup/command_runner.py 73 1 99%
|
|
997
|
+
src/dar_backup/config_settings.py 66 8 88%
|
|
998
|
+
src/dar_backup/dar_backup.py 535 56 90%
|
|
999
|
+
src/dar_backup/dar_backup_systemd.py 56 7 88%
|
|
1000
|
+
src/dar_backup/installer.py 59 6 90%
|
|
1001
|
+
src/dar_backup/manager.py 351 56 84%
|
|
1002
|
+
src/dar_backup/rich_progress.py 70 7 90%
|
|
1003
|
+
src/dar_backup/util.py 130 15 88%
|
|
1004
|
+
----------------------------------------------------------
|
|
1005
|
+
TOTAL 1602 186 88%
|
|
971
1006
|
````
|
|
972
1007
|
|
|
973
1008
|
### dar-backup options
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.6.19"
|
|
@@ -11,6 +11,8 @@ See section 15 and section 16 in the supplied "LICENSE" file
|
|
|
11
11
|
|
|
12
12
|
This script can be used to remove (much of) the logged output from `dar`.
|
|
13
13
|
When `dar` verbose options are enabled, quite a lot of information is emitted.
|
|
14
|
+
|
|
15
|
+
If a rerex is matched, the entire line is removed (change in v2-beta-0.6.19).
|
|
14
16
|
"""
|
|
15
17
|
|
|
16
18
|
|
|
@@ -19,7 +21,7 @@ import re
|
|
|
19
21
|
import os
|
|
20
22
|
import sys
|
|
21
23
|
|
|
22
|
-
from
|
|
24
|
+
from dar_backup import __about__ as about
|
|
23
25
|
from dar_backup.config_settings import ConfigSettings
|
|
24
26
|
|
|
25
27
|
LICENSE = '''Licensed under GNU GENERAL PUBLIC LICENSE v3, see the supplied file "LICENSE" for details.
|
|
@@ -32,7 +34,7 @@ def clean_log_file(log_file_path, dry_run=False):
|
|
|
32
34
|
|
|
33
35
|
if not os.path.isfile(log_file_path):
|
|
34
36
|
print(f"File '{log_file_path}' not found!")
|
|
35
|
-
sys.exit(
|
|
37
|
+
sys.exit(127)
|
|
36
38
|
|
|
37
39
|
if not os.access(log_file_path, os.R_OK):
|
|
38
40
|
print(f"No read permission for '{log_file_path}'")
|
|
@@ -49,13 +51,18 @@ def clean_log_file(log_file_path, dry_run=False):
|
|
|
49
51
|
temp_file_path = log_file_path + ".tmp"
|
|
50
52
|
|
|
51
53
|
patterns = [
|
|
54
|
+
r"INFO\s*-\s*Inspecting\s*directory",
|
|
55
|
+
r"INFO\s*-\s*Finished\s*Inspecting",
|
|
52
56
|
r"INFO\s*-\s*<File",
|
|
57
|
+
r"INFO\s*-\s*</File",
|
|
53
58
|
r"INFO\s*-\s*<Attributes",
|
|
59
|
+
r"INFO\s*-\s*</Attributes",
|
|
54
60
|
r"INFO\s*-\s*</Directory",
|
|
55
61
|
r"INFO\s*-\s*<Directory",
|
|
56
|
-
r"INFO\s*-\s
|
|
57
|
-
r"INFO\s*-\s
|
|
58
|
-
r"INFO\s*-\s
|
|
62
|
+
r"INFO\s*-\s*<Catalog",
|
|
63
|
+
r"INFO\s*-\s*</Catalog",
|
|
64
|
+
r"INFO\s*-\s*<Symlink",
|
|
65
|
+
r"INFO\s*-\s*</Symlink",
|
|
59
66
|
]
|
|
60
67
|
|
|
61
68
|
try:
|
|
@@ -70,9 +77,9 @@ def clean_log_file(log_file_path, dry_run=False):
|
|
|
70
77
|
if dry_run:
|
|
71
78
|
print(f"Would remove: {original_line.strip()}") # Print full line for dry-run
|
|
72
79
|
matched = True # Mark that a pattern matched
|
|
73
|
-
|
|
80
|
+
break # No need to check other patterns if one matches
|
|
74
81
|
|
|
75
|
-
if not dry_run and
|
|
82
|
+
if not dry_run and not matched: # In normal mode, only write non-empty lines
|
|
76
83
|
outfile.write(line.rstrip() + "\n")
|
|
77
84
|
|
|
78
85
|
if dry_run and matched:
|
|
@@ -13,6 +13,7 @@ This script removes old DIFF and INCR archives + accompanying .par2 files accord
|
|
|
13
13
|
[AGE] settings in the configuration file.
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
|
+
import argcomplete
|
|
16
17
|
import argparse
|
|
17
18
|
import logging
|
|
18
19
|
import os
|
|
@@ -31,6 +32,7 @@ from dar_backup.util import list_backups
|
|
|
31
32
|
from dar_backup.util import setup_logging
|
|
32
33
|
from dar_backup.util import get_logger
|
|
33
34
|
from dar_backup.util import requirements
|
|
35
|
+
from dar_backup.util import backup_definition_completer, list_archive_completer
|
|
34
36
|
|
|
35
37
|
from dar_backup.command_runner import CommandRunner
|
|
36
38
|
from dar_backup.command_runner import CommandResult
|
|
@@ -186,16 +188,19 @@ def main():
|
|
|
186
188
|
global logger, runner
|
|
187
189
|
|
|
188
190
|
parser = argparse.ArgumentParser(description="Cleanup old archives according to AGE configuration.")
|
|
189
|
-
parser.add_argument('-d', '--backup-definition', help="Specific backup definition to cleanup.")
|
|
191
|
+
parser.add_argument('-d', '--backup-definition', help="Specific backup definition to cleanup.").completer = backup_definition_completer
|
|
190
192
|
parser.add_argument('-c', '--config-file', '-c', type=str, help="Path to 'dar-backup.conf'", default='~/.config/dar-backup/dar-backup.conf')
|
|
191
193
|
parser.add_argument('-v', '--version', action='store_true', help="Show version information.")
|
|
192
194
|
parser.add_argument('--alternate-archive-dir', type=str, help="Cleanup in this directory instead of the default one.")
|
|
193
|
-
parser.add_argument('--cleanup-specific-archives', type=str, help="Comma separated list of archives to cleanup")
|
|
195
|
+
parser.add_argument('--cleanup-specific-archives', type=str, help="Comma separated list of archives to cleanup").completer = list_archive_completer
|
|
194
196
|
parser.add_argument('-l', '--list', action='store_true', help="List available archives.")
|
|
195
197
|
parser.add_argument('--verbose', action='store_true', help="Print various status messages to screen")
|
|
196
198
|
parser.add_argument('--log-level', type=str, help="`debug` or `trace`, default is `info`", default="info")
|
|
197
199
|
parser.add_argument('--log-stdout', action='store_true', help='also print log messages to stdout')
|
|
198
200
|
parser.add_argument('--test-mode', action='store_true', help='Read envvars in order to run some pytest cases')
|
|
201
|
+
|
|
202
|
+
argcomplete.autocomplete(parser)
|
|
203
|
+
|
|
199
204
|
args = parser.parse_args()
|
|
200
205
|
|
|
201
206
|
args.config_file = os.path.expanduser(os.path.expandvars(args.config_file))
|