Feature request] backup_include_paths in addition backup_exclude_paths

websafe

Verified User
Joined
Jun 15, 2010
Messages
103
Location
Opole, PL
There's is a nice new feature
backup_exclude_paths
https://www.directadmin.com/features.php?id=1737 which allows to exclude some directories from backups, like:

Code:
Maildir/.INBOX.spam/*
Maildir/.Trash/*
imap/*/*/Maildir/.INBOX.spam/*
imap/*/*/Maildir/.Trash/*

And this is great, but it would be even better to have something like
backup_include_paths


Example usage:


in /home/user/.backup_exclude_paths:

Code:
.spamassassin/*

(to exclude all junk that stays in /home/user/.spamassassin/)

and in /home/user/.backup_include_paths:
Code:
.spamassassin/user_prefs

to still include user_prefs in the backup.

That's just an example.
 
Now I see it's probably NOT possible to exclude paths like:

Code:
Maildir/.INBOX.spam/*
Maildir/.Trash/*
imap/*/*/Maildir/.INBOX.spam/*
imap/*/*/Maildir/.Trash/*


And I don't understand why...
 
Why should that not be possible? I think you're reading it wrong.
The format of the file must be relative to /home/user and should not include a "/home/user" prefix.
So it doesn't matter if the path you want to exclude is in /home/user or /home/user/domains, it will still be excluded.

As far as I understand it, excluding like the spamdir you mention would only require a line like:
Maildir/.INBOX.spam/
and then the complete .INBOX.spam path will be excluded from backup.

However, since you wanted them included, you don't have to worry about this, your request is already fullfilled, or am I mistaken? ;)
 
Not really Richard ;-) I wanted to exclude all junk in `/home/user/.spamassassin/*`
but include `/home/user/.spamassassin/user_prefs`.

I will investigate this and continue this thread, but I have to wait
until my backup is finished, then I'll be able to verify what went
as expected and what not ;-)
 
Now I understand you better.
I'm very curious as to the results of your tests, because it would indeed be nice if junk can indeed be excluded!
 
OK, now I've checked the result. It's OK. Using `backup_exclude_paths`
https://www.directadmin.com/features.php?id=1737 works, so you can
exclude spam/trash and other folders from backups as shown
in my previous post.

But what I wrote in the first post is still valid, it would be great to
have something like `backup_include_paths` in addition
to backup_exclude_paths as described in #1
http://forum.directadmin.com/showthread.php?t=52947&p=271769#post271769


There's however a small inconvenience when using `backup_exclude_paths`,
a new thread was started for this issue http://forum.directadmin.com/showthread.php?t=52978&p=271962
 
Last edited:
Nice to hear from you about the result.
However I don't quite understand why a "backup_include_paths" would still be neede or wanted then. Maybe I'm missing something.

I agree on your inconvenience about copying, this could also cause quota issues during backup for example.
 
A short example, each user has a `.spamassassin` subdir.
This directory contains a lot of unnecessary files and one file
that is important (user_prefs).

Code:
# tree /home/user/.spamassassin/

/home/username/.spamassassin/
├── auto-whitelist
├── auto-whitelist.mutex
├── bayes_journal
├── bayes.lock.my.hostname.tld.10769
├── bayes.lock.my.hostname.tld.1199
├── bayes.lock.my.hostname.tld.12655
├── bayes.lock.my.hostname.tld.12726
├── bayes.lock.my.hostname.tld.14135
├── bayes.lock.my.hostname.tld.16270
├── bayes.lock.my.hostname.tld.21114
├── bayes.lock.my.hostname.tld.21204
├── bayes.lock.my.hostname.tld.22754
├── bayes.lock.my.hostname.tld.23086
├── bayes.lock.my.hostname.tld.23192
├── bayes.lock.my.hostname.tld.23261
├── bayes.lock.my.hostname.tld.23597
├── bayes.lock.my.hostname.tld.25267
├── bayes.lock.my.hostname.tld.25775
├── bayes.lock.my.hostname.tld.27296
├── bayes.lock.my.hostname.tld.28035
├── bayes.lock.my.hostname.tld.28272
├── bayes.lock.my.hostname.tld.29108
├── bayes.lock.my.hostname.tld.30123
├── bayes.lock.my.hostname.tld.30535
├── bayes.lock.my.hostname.tld.30835
├── bayes.lock.my.hostname.tld.31067
├── bayes.lock.my.hostname.tld.5397
├── bayes.lock.my.hostname.tld.8446
├── bayes.lock.my.hostname.tld.9115
├── bayes.mutex
├── bayes_seen
├── bayes_toks
├── bayes_toks.expire12890
├── bayes_toks.expire25775
├── bayes_toks.expire399
└── user_prefs


With `.backup_exclude_paths` I can exclude

Code:
.spamassassin/*

but I need something like `backup_include_paths` to still have
`spamassassin/user_prefs` included in the backup.


Of course I could do:

Code:
.spamassassin/auto_whitelist
.spamassassin/auto_whitelist.mutex
.spamassassin/bayes*

in `/home/user/.backup_exclude_paths` and this would
not exclude user_prefs, but it would be easier to exclude
everything:

Code:
.spamassassin/*

and include only required files:

Code:
.spamassassin/user_prefs


Maybe the `.spamassassin` subdir is not the best example.
 
I understand what you mean.
But as you explained yourself, there is another way you could do that too which takes some more effort, but that's probably only once or twice when the exclude file is made.
I don't know how difficult this is programming wise, because one in that case there has to be some priority issues made or a certain order needs to be respected. I'm not sure if it's worth the effort.
But you might get a lot of votes, one never nows. ;)
 
Back
Top