PDA

View Full Version : Sync Mirror:Left->Right not deleting empty folders


Pete
28-Dec-2003, 12:37 AM
I have a script that is not deleting empty folders on the right side. My script is like this:

load "My Session"
sync mirror:left->right

The left side is an FTP site and the right side is a local NTFS disk.

When I run the session in the GUI, it deletes the empty folders on the right, but this doesn't work when I run the script.

Perhaps I'm doing something wrong as this is my first script and I understand that the Sync script command is still in beta.

Also, what is the difference between Sync Update and Sync Mirror?

(build 211 on WinXP)

Craig
28-Dec-2003, 08:53 AM
I'll look into it on Monday; the script looks right, so it's probably a bug in how scripts handle empty folders.

As for your other question:

Update copies newer and orphan files from the source to the destination. It leaves files that are newer or orphans in the destination alone, so it's good for incremental backups. The bidirectional update copies newer and orphan files in both directions, so it should handle cases where you've updated files on both sides, but won't handle deletes. The update command does not overwrite files that are different but have the same timestamp on both sides.

Mirror makes the destination directory exactly like the source one. It will copy older, newer, and orphan files from the source and delete any orphan files in the source.

Pete
04-Jan-2004, 08:37 PM
I'm not sure if you planned to fix this in build 212, but I just downloaded and tested it and it's still not working as I would expect.

Here's an example:

1) Left Side: create a new file inside a new folder.

2) Do a sync as per my script above.

(Now, both sides contain the new file & folder.)

3) Delete the new file and the new folder on the left side.

4) Run the sync script again.

Left Side: new file and new folder are gone.

Right Side: new file is gone, but new folder still exists (incorrectly).

Thanks.

Craig
05-Jan-2004, 11:03 AM
Thanks for the reminder.

This is due to a bug in the way the "Create Empty Folders" flag is being handled. It's actually in the interactive sync too, but you probably have that option checked so you wouldn't see it there.

This will be fixed in the next release. You can work around it in the current one by adding the create-empty flag to the sync command: sync create-empty mirror:left->right. You'll probably want that set for mirror syncs anyway.

Pete
05-Jan-2004, 12:23 PM
The "create-empty" flag solves the problem for me. Thanks.

Pete
23-Jan-2004, 02:08 PM
For build 215, I read in the release notes:
Fixed "Synchronize Folders" handling of empty folders.

Could someone elaborate on this?

1) I'm assuming that it won't affect my manual syncs (in options, I enable "Create Empty Folders").

2) In my script I'm currently using "sync create-empty mirror:left->right". Does the create-empty flag have any effect in this command now? Isn't it redundant since I'm using the mirror command? Can I remove the create-empty flag?

Thanks in advance.

Craig
24-Jan-2004, 09:20 PM
I don't have a specific reference handy right now, but I think there were two issues: It wasn't deleting empty orphaned folders in certain circumstances, and the "Only affect visible files" option was overridding the "Create empty folders" command. It was a weird combination, but we switched it to be compatible with v2.0.

You'll still need create-empty when doing a mirror synch. I realize it would be a bit weird to not want that behavior, but again, we wanted to be compatible with the v2.0 behavior.