S3Sync.net

General Category => Questions => Topic started by: frobitz on February 21, 2010, 10:22:41 AM



Title: Specifying which local folders to sync and not to sync in directory
Post by: frobitz on February 21, 2010, 10:22:41 AM
Hi,

I've got this s3sync working pretty well backing up my /Users/<username> directory under OS X.

However I'd like to specify which folders with this directory should and shouldn't be synced.

For instance I want to omit the folders 'Library' as its just a load of system files I don't want to backup, and 'Downloads' as the content is very temporary.

How can I specify a list of folders to sync, or a list of folders not to sync witin the parent folder?

Currently I have this:

Code:
/usr/bin/ruby $INSTALL_LOCATION/s3sync.rb -r --ssl --delete /Users/<username>  $BUCKET:/

Would the code below be an acceptable solution? And if so, is there a better way than this?

Code:
/usr/bin/ruby $INSTALL_LOCATION/s3sync.rb -r --ssl --delete /Users/<username>/folder-to-sync-1  $BUCKET:/
/usr/bin/ruby $INSTALL_LOCATION/s3sync.rb -r --ssl --delete /Users/<username>/folder-to-sync-2  $BUCKET:/
/usr/bin/ruby $INSTALL_LOCATION/s3sync.rb -r --ssl --delete /Users/<username>/folder-to-sync-3  $BUCKET:/

Thanks for any help

R


Title: Re: Specifying which local folders to sync and not to sync in directory
Post by: frobitz on February 21, 2010, 10:51:51 AM
Well i found the --exclude command (how i missed it I don't know!)

Documentation is a bit light, but after some googling I put this together:

Code:
/usr/bin/ruby $INSTALL_LOCATION/s3sync.rb -r --ssl --delete --exclude="Library$|Desktop$|Downloads$|Temp$|Sites$|Script$|Public$|.Trash$|.adobe$" /Users/<username>  $BUCKET:/

My only concern now is my use of regexp. Are the .adobe and .Trash files going to be understood or do i need to escape the period marks out?

Any other thoughts on this command and its possible faults?

Ta

R