rsync (which is called from dietpi-backup) seems not to backup a directory depth > 2.
Q: Is this a known behaviour or can this be overcome by a different “include” line in the file /boot/dietpi/.dietpi_backup_inc_exc?
Required Information
DietPi version | v8.11
Debian Bullseye
Seen on several different hardwares (ODROID, PC, VM,…)
Additional Information (if applicable)
Software title | Dietpi-Backup (-> rsync -V shows version 3.2.3)
Tested on minimal installation
Steps to reproduce
dietpi-backup was executed with a filter contents like
In every directory is a file stored to see the backup result in the data directory of the backup (rsync) target directory.
Expected behaviour
All three directory structures should be backed up with the contained files.
Actual behaviour
Only the directory structure /mnt/backuptest1 is backed up (tested only with absolute path beginning with a “/”).
I.e., directories based on more than a depth of 2 are not backed up. Also they are not present as empty directories in the backup.
Extra details
I did not find any hints in the rsync man pages resp. documentation.
Also tested with Debian Bookworm, which contains rsync version 3.2.6: No difference.
nope, we backup the entire system using rsync, which include directories with a depth > 2 as well. Other than that, the backup would be inconsistent and not usable for restore.
How did you setup the filter? For me following filter setting is working fine
The given directory structure was a structure for testing the max depth in the .dietpi_backup_inc_exc file.
The real structure is: /mnt/nvme_disk/RaidBackupDir (shall not be backed up) and /mnt/nvme_disk/samba-server (shall be backed up)
With /mnt/nvme_disk is a mounted disk.
The filter contents I wanted is + /mnt/nvme_disk/samba-server/
which did not work due to the 3rd entry samba-server of the path value.
(Also a test with samba_server did not work.)
So the only thing could be to mount the nvme_disk not to mnt and mount it into / instead to get rid of one directory level.
IMO the filter works line by line, see config file:
# Since the list is processed from top to bottom and the first match defines the result,
# includes need to be defined before their wildcard exclude rule
# and in case excludes before their wildcard include rule.
So a
+ /mnt
- /mnt/dietpi-backup*
should not work because the +/mnt overrides the following line.
Every (otherwise excluded) parent directory of an included directory needs to be included as well. In this case rsync skips /mnt/backuptest2 and /mnt/backuptest3 all together, so the 2nd and 3rd rule have no effect. Instead try: