dietpi-backup not excluding directories

I’m having issues making dietpi-backup to exclude directories from my user data folder.

This is my /DietPi/dietpi/.dietpi-backup_exclude file

/mnt/petri
/mnt/data/dietpi-backup
/mnt/data/dietpi_userdata/downloads
/mnt/dietpi_userdata/dietpi-backup
/mnt/dietpi_userdata/downloads

When running dietpi-backup I can see it adds my directories to the ‘exclude list’ at /tmp/.dietpi-backup_inc_exc_list

/mnt/data/dietpi_userdata is my custom user data location.

Any idea how can I debug and find the problem?

Thanks,
Abraham

Hi,

You need to do it this way, using additional / at the end, else rsync treats it as a file I believe:

/mnt/petri/
/mnt/data/dietpi-backup/
/mnt/data/dietpi_userdata/downloads/
/mnt/dietpi_userdata/dietpi-backup/
/mnt/dietpi_userdata/downloads/

Thanks for the help. I tried this but didn’t work.

After looking at the dietpi-backup code it looks I can’t exclude directories when it’s doing a user data backup, it only works for a system backup :frowning:

#rsync options
RSYNC_RUN_OPTIONS_SYSTEM_BACKUP="-aH --delete --include-from=$FP_FILTER_INCLUDE_EXCLUDE_SYSTEM_BACKUP"
RSYNC_RUN_OPTIONS_USERDATA_BACKUP="-aH --delete"
RSYNC_LOGGING_OPTIONS="-v --log-file=$LOGFILE"

Ah, Thanks.

We’ll get this resolved for v6.10, most likley have 2 new files, one for userdata and one for system. Both having include/exclude in the same file using - and +.

Ticket: https://github.com/Fourdee/DietPi/issues/1851

Thank you ! :slight_smile: