dar-backup 0.6.16__py3-none-any.whl → 0.6.18__py3-none-any.whl
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/Changelog.md +217 -0
- dar_backup/README.md +1082 -0
- dar_backup/__about__.py +1 -1
- dar_backup/cleanup.py +42 -57
- dar_backup/command_runner.py +81 -0
- dar_backup/config_settings.py +7 -1
- dar_backup/dar-backup.conf +1 -1
- dar_backup/dar_backup.py +152 -49
- dar_backup/dar_backup_systemd.py +119 -0
- dar_backup/installer.py +39 -23
- dar_backup/manager.py +74 -44
- dar_backup/rich_progress.py +101 -0
- dar_backup/util.py +29 -134
- {dar_backup-0.6.16.dist-info → dar_backup-0.6.18.dist-info}/METADATA +283 -80
- dar_backup-0.6.18.dist-info/RECORD +21 -0
- {dar_backup-0.6.16.dist-info → dar_backup-0.6.18.dist-info}/entry_points.txt +1 -0
- dar_backup-0.6.16.dist-info/RECORD +0 -16
- {dar_backup-0.6.16.dist-info → dar_backup-0.6.18.dist-info}/WHEEL +0 -0
- {dar_backup-0.6.16.dist-info → dar_backup-0.6.18.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dar-backup
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.18
|
|
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
|
+
Project-URL: GPG Public Key, https://keys.openpgp.org/search?q=dar-backup@pm.me
|
|
5
6
|
Project-URL: Homepage, https://github.com/per2jensen/dar-backup/tree/main/v2
|
|
6
7
|
Project-URL: Changelog, https://github.com/per2jensen/dar-backup/blob/main/v2/Changelog.md
|
|
7
|
-
Project-URL: Issues, https://github.com/per2jensen
|
|
8
|
-
Author-email: dar-backup <
|
|
8
|
+
Project-URL: Issues, https://github.com/per2jensen
|
|
9
|
+
Author-email: dar-backup <dar-backup@pm.me>
|
|
9
10
|
License: GNU GENERAL PUBLIC LICENSE
|
|
10
11
|
Version 3, 29 June 2007
|
|
11
12
|
|
|
@@ -689,11 +690,14 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
689
690
|
Classifier: Topic :: System :: Archiving :: Backup
|
|
690
691
|
Requires-Python: >=3.9
|
|
691
692
|
Requires-Dist: inputimeout>=1.0.4
|
|
693
|
+
Requires-Dist: rich>=13.0.0
|
|
692
694
|
Description-Content-Type: text/markdown
|
|
693
695
|
|
|
694
696
|
<!-- markdownlint-disable MD024 -->
|
|
695
697
|
# Full, differential or incremental backups using 'dar'
|
|
696
698
|
|
|
699
|
+
[](https://codecov.io/gh/per2jensen/dar-backup)
|
|
700
|
+
|
|
697
701
|
The wonderful 'dar' [Disk Archiver](https://github.com/Edrusb/DAR) is used for
|
|
698
702
|
the heavy lifting, together with the par2 suite in these scripts.
|
|
699
703
|
|
|
@@ -705,6 +709,7 @@ This is the `Python` based **version 2** of `dar-backup`.
|
|
|
705
709
|
- [My use case](#my-use-case)
|
|
706
710
|
- [License](#license)
|
|
707
711
|
- [Status](#status)
|
|
712
|
+
- [GPG Signing key](#gpg-signing-key)
|
|
708
713
|
- [Breaking change in version 0.6.0](#breaking-change-in-version-060)
|
|
709
714
|
- [Homepage - Github](#homepage---github)
|
|
710
715
|
- [Requirements](#requirements)
|
|
@@ -720,6 +725,7 @@ This is the `Python` based **version 2** of `dar-backup`.
|
|
|
720
725
|
- [.darrc](#darrc)
|
|
721
726
|
- [Backup definition](#backup-definition-example)
|
|
722
727
|
- [Systemd examples](#systemctl-examples)
|
|
728
|
+
- [Generate systemd files](#generate-systemd-files)
|
|
723
729
|
- [Service: dar-back --incremental-backup](#service-dar-backup---incremental-backup)
|
|
724
730
|
- [Timer: dar-back --incremental-backup](#timer-dar-backup---incremental-backup)
|
|
725
731
|
- [List contents of an archive](#list-contents-of-an-archive)
|
|
@@ -744,13 +750,17 @@ This is the `Python` based **version 2** of `dar-backup`.
|
|
|
744
750
|
- [Performance tip due to par2](#performance-tip-due-to-par2)
|
|
745
751
|
- [.darrc sets -vd -vf (since v0.6.4)](#darrc-sets--vd--vf-since-v064)
|
|
746
752
|
- [Separate log file for command output](#separate-log-file-for-command-output)
|
|
753
|
+
- [Skipping cache directories](#skipping-cache-directories)
|
|
754
|
+
- [Progress bar + current directory](#progress-bar-and-current-directory)
|
|
747
755
|
- [Todo](#todo)
|
|
748
756
|
- [Reference](#reference)
|
|
749
|
-
- [
|
|
750
|
-
- [
|
|
751
|
-
- [
|
|
752
|
-
- [
|
|
753
|
-
- [
|
|
757
|
+
- [Test coverage report](#test-coverage)
|
|
758
|
+
- [dar-backup](#dar-backup-options)
|
|
759
|
+
- [manager](#manager-options)
|
|
760
|
+
- [cleanup](#cleanup-options)
|
|
761
|
+
- [clean-log](#clean-log-options)
|
|
762
|
+
- [installer](#installer-options)
|
|
763
|
+
- [dar-backup-systemd](#dar-backup-systemd)
|
|
754
764
|
|
|
755
765
|
## My use case
|
|
756
766
|
|
|
@@ -781,6 +791,85 @@ As of August 8, 2024 I am using the alpha versions of `dar-backup` (alpha-0.5.9
|
|
|
781
791
|
|
|
782
792
|
As of February 13, 2025, I have changed the status from alpha --> beta, as the featureset is in place and the alphas have worked well for a very long time.
|
|
783
793
|
|
|
794
|
+
### GPG Signing key
|
|
795
|
+
|
|
796
|
+
To increase the security and authenticity of dar-backup packages, all releases from v2-beta-0.6.18 onwards will be digitally signed using the GPG key below.
|
|
797
|
+
|
|
798
|
+
🔐 GPG Signing Key Details
|
|
799
|
+
|
|
800
|
+
```` text
|
|
801
|
+
Name: Per Jensen (author of dar-backup)
|
|
802
|
+
Email: dar-backup@pm.me
|
|
803
|
+
Primary key: 4592 D739 6DBA EFFD 0845 02B8 5CCE C7E1 6814 A36E
|
|
804
|
+
Signing key: B54F 5682 F28D BA36 22D7 8E04 58DB FADB BBAC 1BB1
|
|
805
|
+
Created: 2025-03-29
|
|
806
|
+
Expires: 2030-03-28
|
|
807
|
+
Key type: ed25519 (primary, SC)
|
|
808
|
+
Subkeys: ed25519 (S), ed25519 (A), cv25519 (E)
|
|
809
|
+
````
|
|
810
|
+
|
|
811
|
+
🔏 Where to Find Release Signatures
|
|
812
|
+
|
|
813
|
+
PyPI does *Not* host .asc Signature Files
|
|
814
|
+
|
|
815
|
+
Although the `dar-backup` packages on PyPI are GPG-signed, PyPI itself does **not support uploading** .asc detached signature files alongside `.whl` and `.tar.gz` artifacts.
|
|
816
|
+
|
|
817
|
+
Therefore, you will not find `.asc` files on PyPI.
|
|
818
|
+
|
|
819
|
+
✅ Where to Get `.asc` Signature Files
|
|
820
|
+
|
|
821
|
+
You can always download the signed release artifacts and their `.asc` files from the official GitHub Releases page:
|
|
822
|
+
|
|
823
|
+
📁 GitHub Releases for `dar-backup`
|
|
824
|
+
|
|
825
|
+
Each release includes:
|
|
826
|
+
|
|
827
|
+
- `dar_backup-x.y.z.tar.gz`
|
|
828
|
+
|
|
829
|
+
- `dar_backup-x.y.z.tar.gz.asc`
|
|
830
|
+
|
|
831
|
+
- `dar_backup-x.y.z-py3-none-any.whl`
|
|
832
|
+
|
|
833
|
+
- `dar_backup-x.y.z-py3-none-any.whl.asc`
|
|
834
|
+
|
|
835
|
+
🔐 How to Verify a Release from GitHub
|
|
836
|
+
|
|
837
|
+
1. Import the GPG public key:
|
|
838
|
+
|
|
839
|
+
```` bash
|
|
840
|
+
curl https://keys.openpgp.org/vks/v1/by-fingerprint/4592D7396DBAEFFD084502B85CCEC7E16814A36E | gpg --import
|
|
841
|
+
````
|
|
842
|
+
|
|
843
|
+
2. Download the wheel or tarball and its .asc signature from the GitHub.
|
|
844
|
+
|
|
845
|
+
3. Run GPG to verify it:
|
|
846
|
+
|
|
847
|
+
```` bash
|
|
848
|
+
gpg --verify dar_backup-x.y.z.tar.gz.asc dar_backup-x.y.z.tar.gz
|
|
849
|
+
# or
|
|
850
|
+
gpg --verify dar_backup-x.y.z-py3-none-any.whl.asc dar_backup-x.y.z-py3-none-any.whl
|
|
851
|
+
````
|
|
852
|
+
|
|
853
|
+
4. If the signature is valid, you'll see:
|
|
854
|
+
|
|
855
|
+
```` text
|
|
856
|
+
gpg: Good signature from "Per Jensen (author of dar-backup) <dar-backup@pm.me>"
|
|
857
|
+
````
|
|
858
|
+
|
|
859
|
+
🛡️ Reminder: Verify the signing subkey
|
|
860
|
+
|
|
861
|
+
Only this subkey is used to sign PyPI packages:
|
|
862
|
+
|
|
863
|
+
```` text
|
|
864
|
+
B54F 5682 F28D BA36 22D7 8E04 58DB FADB BBAC 1BB1
|
|
865
|
+
````
|
|
866
|
+
|
|
867
|
+
You can view it with:
|
|
868
|
+
|
|
869
|
+
```` bash
|
|
870
|
+
gpg --list-keys --with-subkey-fingerprints dar-backup@pm.me
|
|
871
|
+
````
|
|
872
|
+
|
|
784
873
|
### Breaking change in version 0.6.0
|
|
785
874
|
|
|
786
875
|
Version 0.6.0 and forwards requires the config variable *COMMAND_TIMEOUT_SECS* in the config file.
|
|
@@ -807,15 +896,24 @@ On Ubuntu, install the requirements this way:
|
|
|
807
896
|
|
|
808
897
|
### dar-backup
|
|
809
898
|
|
|
810
|
-
`dar-backup` is built in a way that emphasizes getting backups. It loops over the backup definitions, and in the event of a failure while backing up a backup definition, dar-backup shall log an error and start working on the next backup definition.
|
|
899
|
+
`dar-backup` is built in a way that emphasizes getting backups. It loops over the [backup definitions](#backup-definition-example), and in the event of a failure while backing up a backup definition, dar-backup shall log an error and start working on the next backup definition.
|
|
811
900
|
|
|
812
901
|
There are 3 levels of backups, FULL, DIFF and INCR.
|
|
813
902
|
|
|
814
|
-
- The author does a FULL yearly backup once a year. This includes all files in all directories as defined in the backup definition(s).
|
|
815
|
-
- The author makes a DIFF once a month. The DIFF backs up new and changed files compared to the FULL backup.
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
903
|
+
- The author does a FULL yearly backup once a year. This includes all files in all directories as defined in the backup definition(s) (assuming `-d` was not given).
|
|
904
|
+
- The author makes a DIFF once a month. The DIFF backs up new and changed files **compared** to the **FULL** backup.
|
|
905
|
+
|
|
906
|
+
- No DIFF backups are taken until a FULL backup has been taken for a particular backup definition.
|
|
907
|
+
|
|
908
|
+
- The author takes an INCR backup every 3 days. An INCR backup includes new and changed files **compared** to the **DIFF** backup.
|
|
909
|
+
|
|
910
|
+
- So, a set of INCR's will contain duplicates (this might change as I become more used to use the catalog databases)
|
|
911
|
+
|
|
912
|
+
- No INCR backups are taken until a DIFF backup has been taken for a particular backup definition.
|
|
913
|
+
|
|
914
|
+
After each backup of a backup definition, `dar-backup` tests the archive and then performs a few restore operations of random files from the archive (see [dar-backup.conf](#config-file)). The restored files are compared to the originals to check if the restore went well.
|
|
915
|
+
|
|
916
|
+
`dar-backup` skips doing a backup of a backup definition if an archive is already in place. So, if you for some reason need to take a new backup on the same date, the first archive must be deleted (I recommend using [cleanup](#cleanup-1)).
|
|
819
917
|
|
|
820
918
|
### cleanup
|
|
821
919
|
|
|
@@ -823,8 +921,18 @@ The `cleanup` application deletes DIFF and INCR if the archives are older than t
|
|
|
823
921
|
|
|
824
922
|
`cleanup` will only remove FULL archives if the option `--cleanup-specific-archives` is used. It requires the user to confirm deletion of FULL archives.
|
|
825
923
|
|
|
924
|
+
### manager
|
|
925
|
+
|
|
926
|
+
`dar`has the concept of catalogs which can be exported and optionally be added to a catalog database. That database makes it much easier to restore the correct version of a backed up file if for example a target date has been set.
|
|
927
|
+
|
|
928
|
+
`dar-backup` adds archive catalogs to their databases (using the `manager` script). Should the operation fail, `dar-backup` logs an error and continue with testing and restore validation tests.
|
|
929
|
+
|
|
826
930
|
## How to run
|
|
827
931
|
|
|
932
|
+
📦 All official dar-backup releases from v2-beta-0.6.18 are signed with GPG.
|
|
933
|
+
|
|
934
|
+
See more [here](#gpg-signing-key).
|
|
935
|
+
|
|
828
936
|
### 1 - installation
|
|
829
937
|
|
|
830
938
|
Installation is currently in a venv. These commands are installed in the venv:
|
|
@@ -839,7 +947,6 @@ Note:
|
|
|
839
947
|
|
|
840
948
|
The module `inputimeout` is installed into the venv and used for the confirmation input (with a 30 second timeout)
|
|
841
949
|
|
|
842
|
-
|
|
843
950
|
To install, create a venv and run pip:
|
|
844
951
|
|
|
845
952
|
```` bash
|
|
@@ -902,7 +1009,7 @@ manager --create-db
|
|
|
902
1009
|
### 4 - do FULL backups
|
|
903
1010
|
|
|
904
1011
|
Prereq:
|
|
905
|
-
Backup definitions are in place in BACKUP.D_DIR (see config file)
|
|
1012
|
+
[Backup definitions](#backup-definition-example) are in place in BACKUP.D_DIR (see [config file](#config-file)).
|
|
906
1013
|
|
|
907
1014
|
You are ready to do backups of all your backup definitions.
|
|
908
1015
|
|
|
@@ -975,7 +1082,7 @@ SCRIPT_1 = df -h
|
|
|
975
1082
|
|
|
976
1083
|
### .darrc
|
|
977
1084
|
|
|
978
|
-
The package includes a default
|
|
1085
|
+
The package includes a default `darrc` file which configures `dar`.
|
|
979
1086
|
|
|
980
1087
|
You can override the default `.darrc` using the `--darrc` option.
|
|
981
1088
|
|
|
@@ -1106,7 +1213,7 @@ compress-exclusion:
|
|
|
1106
1213
|
|
|
1107
1214
|
### Backup definition example
|
|
1108
1215
|
|
|
1109
|
-
This piece of configuration is a
|
|
1216
|
+
This piece of configuration is a [backup definition](#backup-definition-example). It is placed in the BACKUP.D_DIR (see config file description).
|
|
1110
1217
|
The name of the file is the name of the backup definition.
|
|
1111
1218
|
|
|
1112
1219
|
You can use as many backup definitions as you need.
|
|
@@ -1143,9 +1250,30 @@ You can use as many backup definitions as you need.
|
|
|
1143
1250
|
|
|
1144
1251
|
# bypass directores marked as cache directories
|
|
1145
1252
|
# http://dar.linux.free.fr/doc/Features.html
|
|
1253
|
+
# https://bford.info/cachedir/
|
|
1146
1254
|
--cache-directory-tagging
|
|
1147
1255
|
````
|
|
1148
1256
|
|
|
1257
|
+
## Generate systemd files
|
|
1258
|
+
|
|
1259
|
+
The command `dar-backup-systemd` can generate and optionally install systemd units and timers.
|
|
1260
|
+
|
|
1261
|
+
The timers are set as the author uses them, modify to your taste and needs.
|
|
1262
|
+
|
|
1263
|
+
Example run:
|
|
1264
|
+
|
|
1265
|
+
```` bash
|
|
1266
|
+
dar-backup-systemd --venv /home/user/tmp/venv --dar-path /home/user/.local/dar/bin
|
|
1267
|
+
Generated dar-full-backup.service and dar-full-backup.timer
|
|
1268
|
+
→ Fires on: *-12-30 10:03:00
|
|
1269
|
+
Generated dar-diff-backup.service and dar-diff-backup.timer
|
|
1270
|
+
→ Fires on: *-*-01 19:03:00
|
|
1271
|
+
Generated dar-incr-backup.service and dar-incr-backup.timer
|
|
1272
|
+
→ Fires on: *-*-04/3 19:03:00
|
|
1273
|
+
Generated dar-clean.service and dar-clean.timer
|
|
1274
|
+
→ Fires on: *-*-* 21:07:00
|
|
1275
|
+
````
|
|
1276
|
+
|
|
1149
1277
|
## Systemctl examples
|
|
1150
1278
|
|
|
1151
1279
|
I have dar-backup scheduled to run via systemd --user settings.
|
|
@@ -1168,27 +1296,47 @@ systemctl --user list-timers
|
|
|
1168
1296
|
|
|
1169
1297
|
## Service: dar-backup --incremental-backup
|
|
1170
1298
|
|
|
1171
|
-
|
|
1299
|
+
This is an exmaple of a systemd user service unit.
|
|
1172
1300
|
|
|
1173
|
-
|
|
1301
|
+
File: dar-incr-backup.service
|
|
1302
|
+
|
|
1303
|
+
```` bash
|
|
1304
|
+
/tmp/test$ dar-backup-systemd --venv '$HOME/programmer/dar-backup.py/venv' --dar-path '$HOME/.local/dar/bin'
|
|
1305
|
+
|
|
1306
|
+
Generated dar-full-backup.service and dar-full-backup.timer
|
|
1307
|
+
→ Fires on: *-12-30 10:03:00
|
|
1308
|
+
Generated dar-diff-backup.service and dar-diff-backup.timer
|
|
1309
|
+
→ Fires on: *-*-01 19:03:00
|
|
1310
|
+
Generated dar-incr-backup.service and dar-incr-backup.timer
|
|
1311
|
+
→ Fires on: *-*-04/3 19:03:00
|
|
1312
|
+
Generated dar-cleanup.service and dar-cleanup.timer
|
|
1313
|
+
→ Fires on: *-*-* 21:07:00
|
|
1314
|
+
/tmp/test$
|
|
1315
|
+
(venv) /tmp/test$
|
|
1316
|
+
(venv) /tmp/test$ cat dar-incr-backup.service
|
|
1174
1317
|
[Unit]
|
|
1175
|
-
Description=dar-backup
|
|
1318
|
+
Description=dar-backup INCR
|
|
1176
1319
|
StartLimitIntervalSec=120
|
|
1177
1320
|
StartLimitBurst=1
|
|
1321
|
+
|
|
1178
1322
|
[Service]
|
|
1179
1323
|
Type=oneshot
|
|
1180
1324
|
TimeoutSec=infinity
|
|
1181
1325
|
RemainAfterExit=no
|
|
1182
|
-
|
|
1326
|
+
|
|
1327
|
+
|
|
1328
|
+
ExecStart=/bin/bash -c 'PATH=$HOME/.local/dar/bin:$PATH && . $HOME/programmer/dar-backup.py/venv/bin/activate && dar-backup -I --verbose --log-stdout'
|
|
1183
1329
|
````
|
|
1184
1330
|
|
|
1185
1331
|
## Timer: dar-backup --incremental-backup
|
|
1186
1332
|
|
|
1187
|
-
|
|
1333
|
+
This is an example of a systemd user timer
|
|
1334
|
+
|
|
1335
|
+
File: dar-incr-backup.timer
|
|
1188
1336
|
|
|
1189
1337
|
```` code
|
|
1190
1338
|
[Unit]
|
|
1191
|
-
Description=dar-backup
|
|
1339
|
+
Description=dar-backup INCR timer
|
|
1192
1340
|
|
|
1193
1341
|
[Timer]
|
|
1194
1342
|
OnCalendar=*-*-04/3 19:03:00
|
|
@@ -1367,7 +1515,7 @@ deactivate
|
|
|
1367
1515
|
|
|
1368
1516
|
"dar" in newer versions emits a question about file ownership, which is "answered" with a "no" via the "-Q" option. That in turn leads to an error code 4.
|
|
1369
1517
|
|
|
1370
|
-
Thus the dar option "--comparison-field=ignore-owner" has been placed in the supplied .darrc file (located in the virtual environment where dar-backup is installed).
|
|
1518
|
+
Thus the dar option "--comparison-field=ignore-owner" has been placed in the supplied [.darrc](#darrc) file (located in the virtual environment where dar-backup is installed).
|
|
1371
1519
|
|
|
1372
1520
|
This causes dar to restore without an error.
|
|
1373
1521
|
|
|
@@ -1382,7 +1530,7 @@ My home directory is on a btrfs filesystem, while /tmp (for the restore test) is
|
|
|
1382
1530
|
|
|
1383
1531
|
The restore test can result in an exit code 5, due to the different filesystems used. In order to avoid the errors, the "option "--fsa-scope none" can be used. That will restult in FSA's not being restored.
|
|
1384
1532
|
|
|
1385
|
-
If you need to use this option, un-comment it in the .darrc file (located in the virtual environment where dar-backup is installed)
|
|
1533
|
+
If you need to use this option, un-comment it in the [.darrc](#darrc) file (located in the virtual environment where dar-backup is installed)
|
|
1386
1534
|
|
|
1387
1535
|
## Par2
|
|
1388
1536
|
|
|
@@ -1453,7 +1601,7 @@ Slice size should be smaller than available RAM, apparently a large performance
|
|
|
1453
1601
|
|
|
1454
1602
|
### .darrc sets -vd -vf (since v0.6.4)
|
|
1455
1603
|
|
|
1456
|
-
These .darrc settings make `dar` print the current directory being processed (-vd) and some stats after (-vf)
|
|
1604
|
+
These [.darrc](#darrc) settings make `dar` print the current directory being processed (-vd) and some stats after (-vf)
|
|
1457
1605
|
|
|
1458
1606
|
This is very useful in very long running jobs to get an indication that the backup is proceeding normally.
|
|
1459
1607
|
|
|
@@ -1465,90 +1613,134 @@ In order to not clutter that log file with the output of commands being run, a n
|
|
|
1465
1613
|
|
|
1466
1614
|
The secondary log file can get quite cluttered, if you want to remove the clutter, run the `clean-log`script with the `--file` option, or simply delete it.
|
|
1467
1615
|
|
|
1468
|
-
|
|
1616
|
+
### Skipping cache directories
|
|
1617
|
+
|
|
1618
|
+
The author uses the `--cache-directory-tagging` option in his [backup definitions](#backup-definition-example).
|
|
1619
|
+
|
|
1620
|
+
The effect is that directories with the [CACHEDIR.TAG](https://bford.info/cachedir/) file are not backed up. Those directories contain content fetched from the net, which is of an ephemeral nature and probably not what you want to back up.
|
|
1621
|
+
|
|
1622
|
+
If the option is not in the backup definition, the cache directories are backed up as any other.
|
|
1469
1623
|
|
|
1470
|
-
|
|
1471
|
-
- FULL, DIFF and INCR backups.
|
|
1472
|
-
- cleanup.
|
|
1624
|
+
### Progress bar and current directory
|
|
1473
1625
|
|
|
1626
|
+
If you run dar-backup interactively in a "normal" console on your computer,
|
|
1627
|
+
dar-backup displays 2 visual artifacts to show progress.
|
|
1628
|
+
|
|
1629
|
+
1. a progress bar that fills up and starts over
|
|
1630
|
+
2. a status line showing the directory being backed up. If the directory is big and takes time to backup, the line is not changing, but you will probably know there is a lot to backup.
|
|
1631
|
+
|
|
1632
|
+
The indicators are not shown if dar-backup is run from systemd or if it is used in terminal multiplexers like `tmux` or `screen`. So no polluting of journald logs.
|
|
1633
|
+
|
|
1634
|
+
## Todo
|
|
1635
|
+
|
|
1636
|
+
- Look into a way to move the .par2 files away from the `dar` slices, to maximize chance of good redundancy.
|
|
1474
1637
|
- Add option to dar-backup to use the `dar` option `--fsa-scope none`
|
|
1475
1638
|
|
|
1476
1639
|
## Reference
|
|
1477
1640
|
|
|
1478
|
-
###
|
|
1641
|
+
### test coverage
|
|
1642
|
+
|
|
1643
|
+
Running
|
|
1644
|
+
|
|
1645
|
+
```` bash
|
|
1646
|
+
pytest --cov=dar_backup tests/
|
|
1647
|
+
````
|
|
1648
|
+
|
|
1649
|
+
results for version 0.6.17 in this report:
|
|
1479
1650
|
|
|
1480
|
-
|
|
1651
|
+
```` code
|
|
1652
|
+
---------- coverage: platform linux, python 3.12.3-final-0 -----------
|
|
1653
|
+
Name Stmts Miss Cover
|
|
1654
|
+
-------------------------------------------------------------------------------------
|
|
1655
|
+
venv/lib/python3.12/site-packages/dar_backup/__about__.py 1 0 100%
|
|
1656
|
+
venv/lib/python3.12/site-packages/dar_backup/__init__.py 0 0 100%
|
|
1657
|
+
venv/lib/python3.12/site-packages/dar_backup/clean_log.py 68 14 79%
|
|
1658
|
+
venv/lib/python3.12/site-packages/dar_backup/cleanup.py 196 53 73%
|
|
1659
|
+
venv/lib/python3.12/site-packages/dar_backup/config_settings.py 66 8 88%
|
|
1660
|
+
venv/lib/python3.12/site-packages/dar_backup/dar_backup.py 464 99 79%
|
|
1661
|
+
venv/lib/python3.12/site-packages/dar_backup/installer.py 46 46 0%
|
|
1662
|
+
venv/lib/python3.12/site-packages/dar_backup/manager.py 316 72 77%
|
|
1663
|
+
venv/lib/python3.12/site-packages/dar_backup/util.py 162 34 79%
|
|
1664
|
+
-------------------------------------------------------------------------------------
|
|
1665
|
+
TOTAL 1319 326 75%
|
|
1666
|
+
````
|
|
1667
|
+
|
|
1668
|
+
### dar-backup options
|
|
1669
|
+
|
|
1670
|
+
This script does backups, validation and restoring. It has the following options:
|
|
1481
1671
|
|
|
1482
1672
|
``` code
|
|
1483
|
-
--full-backup
|
|
1484
|
-
--differential-backup
|
|
1485
|
-
--incremental-backup
|
|
1486
|
-
--backup-definition <name>
|
|
1487
|
-
--alternate-reference-archive <file>
|
|
1488
|
-
--config-file <path>
|
|
1489
|
-
--darrc <path>
|
|
1490
|
-
--examples
|
|
1491
|
-
--list
|
|
1492
|
-
--list-contents <archive>
|
|
1493
|
-
--selection <params>
|
|
1494
|
-
--restore <archive>
|
|
1495
|
-
--restore-dir <path>
|
|
1496
|
-
--verbose
|
|
1497
|
-
--suppress-dar-msg
|
|
1498
|
-
--log-level <level>
|
|
1499
|
-
--log-stdout
|
|
1500
|
-
--do-not-compare
|
|
1501
|
-
--version
|
|
1673
|
+
-F, --full-backup Perform a full backup.
|
|
1674
|
+
-D, --differential-backup Perform a differential backup.
|
|
1675
|
+
-I, --incremental-backup Perform an incremental backup.
|
|
1676
|
+
-d, --backup-definition <name> Specify the backup definition file.
|
|
1677
|
+
--alternate-reference-archive <file> Use a different archive for DIFF/INCR backups.
|
|
1678
|
+
-c, --config-file <path> Specify the path to the configuration file.
|
|
1679
|
+
--darrc <path> Specify an optional path to .darrc.
|
|
1680
|
+
--examples Show examples of using dar-backup.py.
|
|
1681
|
+
-l, --list List available backups.
|
|
1682
|
+
--list-contents <archive> List the contents of a specified archive.
|
|
1683
|
+
--selection <params> Define file selection for listing/restoring.
|
|
1684
|
+
--restore <archive> Restore a specified archive.
|
|
1685
|
+
-r, --restore-dir <path> Directory to restore files to.
|
|
1686
|
+
--verbose Enable verbose output.
|
|
1687
|
+
--suppress-dar-msg Filter out this from the darrc: "-vt", "-vs", "-vd", "-vf", "-va"
|
|
1688
|
+
--log-level <level> `debug` or `trace`, default is `info`.
|
|
1689
|
+
--log-stdout Also print log messages to stdout.
|
|
1690
|
+
--do-not-compare Do not compare restores to file system.
|
|
1691
|
+
-v --version Show version and license information.
|
|
1502
1692
|
```
|
|
1503
1693
|
|
|
1504
|
-
### manager
|
|
1694
|
+
### manager options
|
|
1505
1695
|
|
|
1506
|
-
This script manages `dar` databases and catalogs. Available options
|
|
1696
|
+
This script manages `dar` databases and catalogs. Available options:
|
|
1507
1697
|
|
|
1508
1698
|
``` code
|
|
1509
|
-
--
|
|
1510
|
-
--
|
|
1511
|
-
--
|
|
1512
|
-
|
|
1513
|
-
--
|
|
1514
|
-
--
|
|
1515
|
-
|
|
1516
|
-
--list-
|
|
1517
|
-
--list-
|
|
1518
|
-
--
|
|
1519
|
-
--
|
|
1520
|
-
--
|
|
1699
|
+
-c, --config-file Path to dar-backup.conf
|
|
1700
|
+
--create-db Create missing databases for all backup definitions.
|
|
1701
|
+
--alternate-archive-dir <path> Use this directory instead of BACKUP_DIR in the config file.
|
|
1702
|
+
--add-dir <path> Add all archive catalogs in this directory to databases.
|
|
1703
|
+
-d, --backup-def <name> Restrict to work only on this backup definition.
|
|
1704
|
+
--add-specific-archive <archive> Add this archive to the catalog database.
|
|
1705
|
+
--remove-specific-archive <archive> Remove this archive from the catalog database.
|
|
1706
|
+
-l, --list-catalogs List catalogs in databases for all backup definitions.
|
|
1707
|
+
--list-catalog-contents <num> List contents of a catalog by catalog number.
|
|
1708
|
+
--list-archive-contents <archive> List contents of an archive’s catalog, given the archive name.
|
|
1709
|
+
--find-file <file> Search catalogs for a specific file.
|
|
1710
|
+
--verbose Enable verbose output.
|
|
1711
|
+
--log-level <level> `debug` or `trace`, default is `info`", default="info".
|
|
1521
1712
|
```
|
|
1522
1713
|
|
|
1523
|
-
### cleanup
|
|
1714
|
+
### cleanup options
|
|
1524
1715
|
|
|
1525
|
-
This script cleans up old backups and
|
|
1716
|
+
This script cleans up old backups and par2 files. Supported options:
|
|
1526
1717
|
|
|
1527
1718
|
``` code
|
|
1528
|
-
-d, --backup-definition
|
|
1529
|
-
-c, --config-file
|
|
1530
|
-
-v, --version
|
|
1531
|
-
--alternate-archive-dir
|
|
1532
|
-
--cleanup-specific-archives <archive>, ...
|
|
1533
|
-
-l,
|
|
1534
|
-
--verbose
|
|
1535
|
-
--log-level <level>
|
|
1536
|
-
--log-stdout
|
|
1719
|
+
-d, --backup-definition Backup definition to cleanup.
|
|
1720
|
+
-c, --config-file Path to 'dar-backup.conf'
|
|
1721
|
+
-v, --version Show version & license information.
|
|
1722
|
+
--alternate-archive-dir Clean up in this directory instead of the default one.
|
|
1723
|
+
--cleanup-specific-archives "<archive>, <>, ..." Comma separated list of archives to cleanup.
|
|
1724
|
+
-l, --list List available archives (filter using the -d option).
|
|
1725
|
+
--verbose Print various status messages to screen.
|
|
1726
|
+
--log-level <level> `debug` or `trace`, default is `info`", default="info".
|
|
1727
|
+
--log-stdout Print log messages to stdout.
|
|
1728
|
+
--test-mode This is used when running pytest test cases
|
|
1537
1729
|
```
|
|
1538
1730
|
|
|
1539
|
-
### clean-log
|
|
1731
|
+
### clean-log options
|
|
1540
1732
|
|
|
1541
1733
|
This script removes excessive logging output from `dar` logs, improving readability and efficiency. Available options:
|
|
1542
1734
|
|
|
1543
1735
|
``` code
|
|
1544
1736
|
-f, --file <path> Specify the log file(s) to be cleaned.
|
|
1545
|
-
-c, --config-file <path>
|
|
1737
|
+
-c, --config-file <path> Path to dar-backup.conf.
|
|
1546
1738
|
--dry-run Show which lines would be removed without modifying the file.
|
|
1547
1739
|
-v, --version Display version and licensing information.
|
|
1548
1740
|
-h, --help Displays usage info
|
|
1549
1741
|
```
|
|
1550
1742
|
|
|
1551
|
-
### installer
|
|
1743
|
+
### installer options
|
|
1552
1744
|
|
|
1553
1745
|
Sets up `dar-backup`for a user.
|
|
1554
1746
|
|
|
@@ -1572,3 +1764,14 @@ Sets up demo config files:
|
|
|
1572
1764
|
-v, --version Display version and licensing information.
|
|
1573
1765
|
-h, --help Displays usage info
|
|
1574
1766
|
```
|
|
1767
|
+
|
|
1768
|
+
### dar-backup-systemd
|
|
1769
|
+
|
|
1770
|
+
Generates and optionally install systemd user service units and timers
|
|
1771
|
+
|
|
1772
|
+
``` code
|
|
1773
|
+
-h, --help Show this help message and exit
|
|
1774
|
+
--venv VENV Path to the Python venv with dar-backup
|
|
1775
|
+
--dar-path DAR_PATH Optional path to dar binary's directory
|
|
1776
|
+
--install Install the units to ~/.config/systemd/user
|
|
1777
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
dar_backup/.darrc,sha256=-aerqivZmOsW_XBCh9IfbYTUvw0GkzDSr3Vx4GcNB1g,2113
|
|
2
|
+
dar_backup/Changelog.md,sha256=ZRK03WnSbNWkMQAVNvfflKs06TGmkB4wBOm0Lp4ft1c,7830
|
|
3
|
+
dar_backup/README.md,sha256=b4eoXh8fo7Li1mJqMKbrW-SrI2gDYkczCtL8G9-KoFE,43261
|
|
4
|
+
dar_backup/__about__.py,sha256=g-mDk6iCtdmWAx2-NGjdBzw-GF98McMHGx0wkhbKFM4,22
|
|
5
|
+
dar_backup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
dar_backup/clean_log.py,sha256=cGhtKYnQJ2ceNQfw5XcCln_WNBasbmlfhO3kRydjDNk,5196
|
|
7
|
+
dar_backup/cleanup.py,sha256=BAiztBL0Dpr3fs6WZU_9oR5jUWumHua4dS37JtSxi-Q,12499
|
|
8
|
+
dar_backup/command_runner.py,sha256=74Fsylz1NN-dn8lbdRhkL6LA1r527QJeojBlniGrPuo,2708
|
|
9
|
+
dar_backup/config_settings.py,sha256=Rh4T35-w_5tpRAViMfv3YP3GBpG4mQy7Do8cNBzYAR0,4912
|
|
10
|
+
dar_backup/dar-backup.conf,sha256=64O3bGlzqupneT2gVeaETJ1qS6-3Exet9Zto27jgwPQ,897
|
|
11
|
+
dar_backup/dar_backup.py,sha256=THZmKZgOWxtYo9HaysU38GZ1hnpTcziJ45sPQ4HvJoE,41003
|
|
12
|
+
dar_backup/dar_backup_systemd.py,sha256=oehD_t9CFu0CsMgDWRH-Gt74Ynl1m29yqQEh5Kxv7aw,3807
|
|
13
|
+
dar_backup/installer.py,sha256=fl2LHHWxuXRT814M_zuZh_YqqLk6nuNg9BI9HpLzdUU,4841
|
|
14
|
+
dar_backup/manager.py,sha256=HRuWeDB1sd14HwMEM6dk6OVqpj2KDTk6y55OKw7vUHE,22420
|
|
15
|
+
dar_backup/rich_progress.py,sha256=jTwM-4VlqHHzKqIfyXjL1pWEriobSJwCdN3YXzXzRdo,3105
|
|
16
|
+
dar_backup/util.py,sha256=2V4ONpoGh_W6wFv2RbJoUIEDxcY6_ot4frtzEBWsu7U,8798
|
|
17
|
+
dar_backup-0.6.18.dist-info/METADATA,sha256=My1Utkqgj1iYhfC4OfWXzzzrU2bPasbWl9usZqS_7bw,84949
|
|
18
|
+
dar_backup-0.6.18.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
19
|
+
dar_backup-0.6.18.dist-info/entry_points.txt,sha256=NSCYoG5Dvh1UhvKWOQPgcHdFv4--R4Sre3d9FwJra3E,258
|
|
20
|
+
dar_backup-0.6.18.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
21
|
+
dar_backup-0.6.18.dist-info/RECORD,,
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
dar_backup/.darrc,sha256=-aerqivZmOsW_XBCh9IfbYTUvw0GkzDSr3Vx4GcNB1g,2113
|
|
2
|
-
dar_backup/__about__.py,sha256=iZmWvp4Ehnidf9YJv6Dpn5Sma5S84lPbQtLoYZ2OuiI,22
|
|
3
|
-
dar_backup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
dar_backup/clean_log.py,sha256=cGhtKYnQJ2ceNQfw5XcCln_WNBasbmlfhO3kRydjDNk,5196
|
|
5
|
-
dar_backup/cleanup.py,sha256=EoT_jTiJmy_HoWxxlWuRn21GoMnr5ioN8yM7qiNRPKE,13351
|
|
6
|
-
dar_backup/config_settings.py,sha256=uicCq6FnpxPFzbv7xfYSXNnQf1tfLk1Z3VIO9M71fsE,4659
|
|
7
|
-
dar_backup/dar-backup.conf,sha256=-wXqP4vj5TS7cCfMJN1nbk-1Sqkq00Tg22ySQXynUF4,902
|
|
8
|
-
dar_backup/dar_backup.py,sha256=PI154FIXZiU36iAyLZCCxAciDeBSwoBXYQh0n5JmNEs,37895
|
|
9
|
-
dar_backup/installer.py,sha256=ehp4KSgTc8D9Edsyve5v3NY2MuDbuTFYQQPgou8woV8,4331
|
|
10
|
-
dar_backup/manager.py,sha256=sQl0xdWwBgui11S9Ekg0hOSC4gt89nz_Z8Bt8IPXCDw,21640
|
|
11
|
-
dar_backup/util.py,sha256=F6U-e-WugxCxLPVoiWsM6_YO8VrDw1wdgGvtnGnig2I,12279
|
|
12
|
-
dar_backup-0.6.16.dist-info/METADATA,sha256=xaYjZK6XAWOc_NHsnktylhdvqWLqzmo94GT1MoR6qLw,76678
|
|
13
|
-
dar_backup-0.6.16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
14
|
-
dar_backup-0.6.16.dist-info/entry_points.txt,sha256=Z7P5BUbhtJxo8_nB9qNIMay2eGDbsMKB3Fjwv3GMa4g,202
|
|
15
|
-
dar_backup-0.6.16.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
16
|
-
dar_backup-0.6.16.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|