When backing up prevent excluding any files in the destination backup directory itself

To prevent bloated archive files, we excluded bunch of such file extensions in the Files to exclude from each domain section as:

*.sql
*.gz
*.tgz
*.zip
*.tar

and everything works as expected. However, the backup system turned out to be enforcing the same exclusion rules against the destination backup directory. That's why the .backup subdirectory is always missing the database file, because it is compressed in .gz format. So as a temporary solution we have removed the .gz extension from our exclusion list above.

However, often time users place any kind of archive files, including in .gz format in home directories, which need to be excluded from regular backups. So please fix this bug in a way that will works just as it is working now, but without applying exclusion rules towards the backup destination directory.

Status: 
Active

Comments

Hmmm .. I'm not sure if we can solve this, because Virtualmin's exclusion feature uses a tar flag that skips matching files regardless of which directory they are in. And the current backup method puts MySQL, DNS and other dumps in the .backup directory in .gz format.

After reading your response, I first thought of one possible solution: to backup everything, but databases first, just the way it works now, and then only backup databases separately and then add to tar file. But then I searched little bit on a subject and found out that tar also has --include counterpart of --exclude, so you could just use it.

Assigned: Unassigned ยป

Passing this along to Joe for further comment.

Using --include isn't a bad idea .. let me see if that would work.

Actually, on my system (CentOS 7) there is no --include flag to tar. So if it does exist, it must only be in later versions.