by Jonathan Capra on Jun 22, 2009 at 10:45:16 pm
I have been using the 'Sync Folders' action for Automator to selectively mirror a directory on a network file server to a matching local copy on local workstations. This has worked great, as the directories in question were usually only one level with only a handful of files... until now...
I am trying to do this sync routine with the Sync Folders action with a source directory that has a large tree of subfolders and a lot of files. As a result, it seems to take a lot of processing everytime we try to do a sync... even if only one small file has changed...
Can anyone suggest a better routine? I had checked out RsyncX, but couldn't get things to run right... If someone has either a more turnkey solution, or a very step-by-step tutorial for RsyncX?
Re: Sync Folders...
by Dustin Lau on Aug 25, 2010 at 9:57:01 am
just use terminal, I'm not a linux geek but it's not really as hard as it seems.
the command is
rsync -avr --progress --exclude '*Render Files*' --delete /your/source/directory /your/destination/directory
I'll break it down for you
is the command that is being run
are switches that specify how the command works
a= archive (so files are copied with the same settings on the destination as the source)
v= verbose (so you have detailed error messages if any)
r= recursive (so files within folders are also copied)
so you know the status of the backup and which file is currently being copied
so you can exclude folders that don't need to be backed up
because folders like Audio Render Files and Render Files have a space between them, we enclose them within ' so that the command does not interpret the space as a cue to look for the next "switch".
The * is a wildcard operand which means all files and folders which contain the phrase 'Render Files' will be ignored, regardless of what is behind or in front of the phrase itself. The location of the * indicates whether the wildcard applies before or after the phrase.
'*Render Files' will detect Audio Render Files but not Render Files for GFX
'Render Files*' will detect Render Files for GFX but not Audio Render Files
This makes the backup a direct mirror of the source at the time of the backup. For example your source contains 2 folders, Project Runway and Drag Race. You finish the Project Runway project and trash the folder.
if --delete is enabled, the backup will also delete Project Runway from the destination, hence the term direct mirror. If you want it to retain files, then do not include --delete.
Bear in mind that if you move files around on your source in between backups you may end up with multiple copies of the same files in their old and new locations.
Can get messy, so to be safe, rsync without --delete, but when your source folder is organized exactly the way you want, add --delete so the correct/organized version is mirrored and the extra/misplaced files are deleted.
An easy way to get your directory locations is to drag the folder into the terminal, the proper location will show up.
You can also download Lingon (google it) which can help you schedule this to run automatically with a number of different triggers.