helpstoreBackup - Support: sr #109036, How to exclude hidden files


sr #109036: How to exclude hidden files

Submitted by:  None
Submitted on:  Wed 11 May 2016 02:26:29 PM UTC  
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 23 May 2016 07:40:00 AM UTC, comment #3: 

Thanks man! You helped me a lot! :)

Sun 22 May 2016 06:06:10 PM UTC, comment #2: 


sorry for the late response but due to a problem with this site I was not able to answer.


Heinz-Josef Claes <hjclaes>
Project Administrator
Sun 22 May 2016 06:05:03 PM UTC, comment #1: 

For me,

exceptRule= '$file =~ \'(/\.)|(^\.)\''

seems to work - but it doesn't do what you want.

Remember, $file contains the relative path plus the filename. So simply using ^\. will only match, if the files are on the top level directory.
Also, with exceptRule you can exclude files but not directories! So the pattern above only excludes singular files starting with a dot.

If you want to exclude directories, you have to use exceptDirs.
The wildcards (not pattern) you need to exclude, depends on the relative path in your backup directory.
Example: If your backupDir is '/', and you want to exclude all dot files in your home directories, use
exceptDirs = //.*
This will e.g. match /home/bob/.something

I'm using:
exceptRule= '$file =~ m#/\.thumbnails/#' or
    '$file =~ m#/te?mp/#i' or
    '$file =~ m#cache/#i' or
    '&::MARK_DIR_REC($file, ".dontBackup")'
This stores the important hidden files but not the garbage in it. Also, I can tag a directory with ".dontBackup" .

Hope this helps.

Heinz-Josef Claes <hjclaes>
Project Administrator
Wed 11 May 2016 02:26:29 PM UTC, original submission:  

I want to exclude hidden files and directories from my backup. I tried to set up an exceptRule (exceptRule='$file =~ /^\./') but it didn't work and I always get this error: 
invalid or no range in param <exceptRule=$file =~ /^\./>, exiting



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by hjclaes (Posted a comment)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.7