Backup a folder contents but NO subfolders

Aug 14, 2012 at 5:01 PM

I am trying to set the selection file to back up just the files in a particular folder, but none of the subfolders. I'm not sure where my trouble is -- am i using the wrong configuration option, am I using the right option in the wrong way, or did I just mess up the regular expression.

I've tried:

includesource=c:\users\dratkins\downloads|alias=down 
matchexcludepath=^down\\.*\\

and also:

includesource=c:\users\dratkins\downloads|alias=down 
stoprecurse=^down\\.*\\

but it still picks up everything in the "downloads" directory.

I'm also trying to set the selection file to back up the files in a particular folder, and in one of its subfolders but not the others. I tried:

includesource=c:\users\dratkins\documents\dev|alias=dev 
matchexcludepath=^dev\\(?!important).*\\

and also:

includesource=c:\users\dratkins\doucments\dev\|alias=dev 
stoprecurse=^dev\\(?!important).*\\

but it picks up everyhing in the dev directory anyway. What am I doing wrong?

Coordinator
Aug 17, 2012 at 7:30 AM
Edited Aug 17, 2012 at 2:55 PM

Hi dratkins, thank you for your post.

Your first question is "how can I backup a single folder's contents but NOT it's subfolders ?". The answer is simple.
Let's assume you have this folder tree:

c:\users\dratkins\downloads
c:\users\dratkins\downloads\subfolder1
c:\users\dratkins\downloads\subfolder2
c:\users\dratkins\downloads\subfolder3
c:\users\dratkins\downloads\music

.. and you want to backup downloads' contents but want the script NOT to enter and scan in subfolder1, subfolder2, subfolder3 and music. Your script's selection rules will be

includesource=c:\users\dratkins\downloads|alias=down
matchstoprecurse=^down

This way the script will enter c:\users\dratkins\downloads and will name it "down" but as it encounters the first subfolder (which will be internally managed as "down\subfolder1") it will not enter it as regular expression "^down" surely matches "down\subfolder1". Please note also that the precise keyword for the selector rule is matchstoprecurse (not stoprecurse only as written in your post). What you have entered instead with the regular expression "^down\\.*\\" means : do not recurse any directory path which begins with down and has backslash and have something after the first backslash and again have a backslash. Of course this is not the case of "down\subfolder1": it might be the case of "down\subfolder1\subfolder1.1"

The second question is quite similar. Assuming the directory tree sample depicted before, consider you want to backup downloads' contents and subfolder1 contents, but NOT subfolder2 nor subfolder3 nor music contents. What you will have to specify in your selection criteria is:

includesource=c:\users\dratkins\downloads|alias=down
matchstoprecurse=^down\\subfolder[0-9]{1}
matchstoprecurse=^down\\music

Hope this helps.

Coordinator
Aug 23, 2012 at 5:48 PM

Hi dratkins,

it might be of your interest the new release 1.8.1 where you can limit recursion process even by depth.

All the best.