Answered by:
Command line folder exclusion

Question
-
I've been tasked with implementing a My Documents backup solution for the workstations in my company, however my director is requiring me to exclude the My Pictures, My Music and My Videos folders, as these will quickly chew up available disk space on the server, and will rarely contain work-related material needing to be backed up. The majority of our workstations are still running XP Pro.
I started messing around with Folder Redirection in Active Directory Group Policy, but realized I would have to run some custom scripting to move the My Music and My Videos files out of the My Documents folder and into the %USERPROFILE% location (like the Vista/Win7 organization) in order to exclude those items from the redirection process (My Pictures is the only one of the media folders that AD group policy will manage on XP).
Enter SyncToy. It seems to be (almost) exactly what I'm looking for, but seems to be a little light on the command-line controls. I can create my folder pair to sync from My Documents out to our network share location, set the Synchronize mode, and give it a name, all from the command line. The only thing that's missing here is the ability to exclude folders from the sync. I see there is an "excluded" option for the SyncToy.exe command, but when I supply excluded="My *" in the command, I see "My *" show up in the Files to Exclude field in the GUI, but running a preview shows that the My folders are still being read. I guess "Files to Exclude" really means just FILES.
How can I automate the creation of my folder pairs (WMI/VBScript accepted) to exclude the "My *" folders so I can deploy this across a couple hundred workstations?
I'm using SyncToy 2.1.Friday, February 12, 2010 8:24 PM
Answers
-
Hi -
Sorry - as you detected correctly we can add an exclusion to for directories only from the GUI ( and not from the command line). Even the GUI does not allow you to add a regular expression like '*'. This is a hack but I think it might work ( please test it out before you use it). On a box that you have the GUI installed - create the folder pair the way that you want it ( by explicitly excluding all the "My*" folders that you you think users potentially can have). THen copy this SyncToy.config file to all the workstations. The first time they open SyncToy - it will say that it cannot find the .dat files that it needs and will ask if it can create new ones. If users - hit yes - it should continue.
Some problems I see ( you need to check if this matters to you).
1) If users end up with any other "MY*" folder other than anything you have on your box - then they will have to manually edit the folder pair again to exclude this.
2) They will need to run SyncToy at least once from the GUI which is a pain if you were planning on doing scheduled sync's from the command line.
Thanks
Deepa
Deepa ( Microsoft Sync Framework)- Marked as answer by Deepa Choundappan Tuesday, February 16, 2010 8:12 PM
Tuesday, February 16, 2010 8:12 PM
All replies
-
My question exactly although, in my case, I want to exclude folders from a My Documents backup because the pen drive I am using is only 8gb and "My Documents" folder is about 25gb. Not to mention the many folders that various software companies I installed placed there (Nero, Sony, Acid Pro etc) that I am not interested in backing up.
Thanks for your help. I am also using SyncToy 2.1.Monday, February 15, 2010 7:25 AM -
Hi -
Sorry - as you detected correctly we can add an exclusion to for directories only from the GUI ( and not from the command line). Even the GUI does not allow you to add a regular expression like '*'. This is a hack but I think it might work ( please test it out before you use it). On a box that you have the GUI installed - create the folder pair the way that you want it ( by explicitly excluding all the "My*" folders that you you think users potentially can have). THen copy this SyncToy.config file to all the workstations. The first time they open SyncToy - it will say that it cannot find the .dat files that it needs and will ask if it can create new ones. If users - hit yes - it should continue.
Some problems I see ( you need to check if this matters to you).
1) If users end up with any other "MY*" folder other than anything you have on your box - then they will have to manually edit the folder pair again to exclude this.
2) They will need to run SyncToy at least once from the GUI which is a pain if you were planning on doing scheduled sync's from the command line.
Thanks
Deepa
Deepa ( Microsoft Sync Framework)- Marked as answer by Deepa Choundappan Tuesday, February 16, 2010 8:12 PM
Tuesday, February 16, 2010 8:12 PM -
Deepa helped me out on another post. Had a similar problem of wanting to exclude folders but for a different reason. Anyhow,I'll tell you what I found which may be of help to you too. I created a pair and then selected: "Change Options" and in that window you will see: "Select Subfolders". Click it and from there (as Deepa told me) you will see a tree of the MY Documents folder where you can uncheck the unwanted folders from the backkup.
Hope this helps.Wednesday, February 17, 2010 5:33 AM -
Deepa helped me out on another post. Had a similar problem of wanting to exclude folders but for a different reason. Anyhow,I'll tell you what I found which may be of help to you too. I created a pair and then selected: "Change Options" and in that window you will see: "Select Subfolders". Click it and from there (as Deepa told me) you will see a tree of the MY Documents folder where you can uncheck the unwanted folders from the backkup.
Hope this helps.
This is what I'm looking for, It's comprehensive.Tuesday, January 25, 2011 6:38 AM