backup only files starting with a dot

Asked by Ben Zuber

I would like to backup my whole system but exclude most of users home area because they contain huge files. From the home area I would like to automatically backup only the files starting with a dot. I thought of the following strategy:
1) create one profile that that includes "/" and excludes "/home/*"
2) create a second profile that include "/home" and excludes everything not starting with a dot in every user's home area. I added the following exclusion pattern:
"/home/**/[^\.]"

The first profile works like expected.
The second one does not: it saves everything in /home and does not exclude anything.
Is there a way to do what I want?

Question information

Language:
English Edit question
Status:
Solved
For:
Back In Time Edit question
Assignee:
No assignee Edit question
Solved by:
Germar
Solved:
Last query:
Last reply:
Revision history for this message
Germar (germar) said :
#1

I didn't test this but I'm pretty sure this is because of the double-asterisk '**'. One asterisk match every char except a slash '/'. Two asterisk also match slashes. So it will match sub folders, too.

Revision history for this message
Ben Zuber (aseedb) said :
#2

Thank you for the suggestion. However it did not work either.

I tried to narrow down the problem:
I now include only my home area : /home/me
I tried to exclude all files starting with a dot :
.*
This works. Only files in my home area and not starting with a dot are backed up.

I can't get the opposite to work. I am not sure of the correct syntax for negation, and if back in time is at all capable of dealing with negation. Whatever I tried such as [^.*] did not exclude anything.

Revision history for this message
Best Germar (germar) said :
#3

Okay, sorry for not double-checking last time.

/home/*/[!.]* does work like expected.

Include and exclude are rsync rules and rsync doesn't use regex. Take a look at 'man rsync' in 'INCLUDE/EXCLUDE PATTERN RULES' section.

Regards,
Germar

Revision history for this message
Ben Zuber (aseedb) said :
#4

Thanks Germar, that solved my question.