PDA

View Full Version : New Foder Synch Questions


Hernandito
26-Jul-2010, 10:32 AM
Sorry, I accidentally posted this in BC v.2. Script Forum. I am using BC3.
================================================== ====

Hello,

My question is probably very simple. I am trying to create a folder comparison script, and following the guide on the web site and the help file, I have come up with the following:

# Turn logging on

log normal "C:\Synclog.txt"

# Load the default session and exclude all but certain file types

load <default>

filter "._.*;Thumbs.db"

# Load the base folders

load "W:\Original" "F:\Backup"

# Copy different files left to right, delete orphans on right

sync mirror:left->right



I am excluding the thumbnail files. However, the files that would be on the "left" folder, I do NOT want to delete orphan files on the "right". In other words, if someone deletes a file from Original folder, I do NOT want the file deleted from the Backup folder.

How can I omit the deleting of orphan files?

Another question, within the same script, can I add another folder synch session? Would it look like this?

# Turn logging on

log normal "C:\Synclog.txt"

# Load the default session and exclude all but certain file types
load <default>
filter "._.*;Thumbs.db"
# Load the base folders
load "W:\Ipod Backup" "f:\Ipod Backup"
# Copy different files left to right, delete orphans on right
sync mirror:left->right


# Load the base folders

load "W:\Original2" "F:\Backup2"

# Copy different files left to right, delete orphans on right

sync mirror:left->right


# Load the base folders

load "W:\Original3" "F:\Backup3"

# Copy different files left to right, delete orphans on right

sync mirror:left->right




Many thanks for the help and advice.

Hernandito

Aaron
26-Jul-2010, 02:36 PM
Hello,

First, please double check your filter statement. I do not think it is filtering out the items you anticipate (it actually includes thumbs.db, for example). And what files did you want to include with "._.*"?

Do test, or create, a filter line, you can load the graphical application and your base folders. They use the Session menu -> Session Settings -> Name Filters tab to designate the file names you with to include or exclude. This dialog will translate into a single string textbox in the upper right corner of the main Folder Compare screen. "-thumbs.db", for example, would exclude all thumbs.db files. You can copy and paste this string into your script to get matching filter behavior.

For your second question, yes, you can load, sync, then load and sync again in script. However, I would test our your script individually on test folders or already backed up folders first. The Mirror command will delete any Orphans on the right side (in order to make the right equal to the left). Since it is a destructive command, you will want to test it first to understand how it is going to behave with your filters before you begin to use it as part of an automated task. If you do not want to delete right Orphans, then you will want to use sync update:left->right instead.
You can experiment with either of these commands in the graphical interface by loading a Folder Compare session, and then using them in the Actions menu -> Synchronize.

Lastly, our script does not actually support Folder Sync sessions in script. Instead we can load either a pair of folders or a Folder Compare session, and then perform sync actions on the loaded folder pair or session. Your script is currently opening a blank Folder Compare session, and then loading a pair of declared folders and a filter.

Hernandito
26-Jul-2010, 03:02 PM
Thank you Aaron!!

This works perfectly. I now realize that to exclude files, I have to use the "-". I ran a test and it worked perfectly.

I will test the multiple load and update command.

For some reason, my system creates these "._.Trashes" files/folders. I don't know if these are because my drives are also seen from Linux or Mac OS. I simply do not want them copied.

Thank you for your wonderful help!!

Hernando