Announcement

Collapse
No announcement yet.

Sync Mirror:Left->Right not deleting empty folders

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sync Mirror:Left->Right not deleting empty folders

    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)

  • #2
    Re: Sync Mirror:Left->Right not deleting empty folders

    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.
    ZoŽ P Scooter Software

    Comment


    • #3
      Re: Sync Mirror:Left->Right not deleting empty folders

      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.

      Comment


      • #4
        Re: Sync Mirror:Left->Right not deleting empty folders

        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.
        ZoŽ P Scooter Software

        Comment


        • #5
          Re: Sync Mirror:Left->Right not deleting empty folders

          The "create-empty" flag solves the problem for me. Thanks.

          Comment


          • #6
            Re: Sync Mirror:Left->Right not deleting empty folders

            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.

            Comment


            • #7
              Re: Sync Mirror:Left->Right not deleting empty folders

              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.
              ZoŽ P Scooter Software

              Comment


              • #8
                Originally posted by ZoŽ View Post
                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.
                I realize it's an old thread but considering the issue has still not been fixed, I'll post here to see what the current status is. I just attempted my first sync job (Mirror to Right) with default settings for two drives and was surprised to find many empty folders left behind on the right side result. These are folders (and sub folders) where files used to exist, now just empty folders left. This seems like an odd default behavior, is there a setting I need to change to truly mirror the two drives?

                Comment


                • #9
                  In Beyond Compare 4's Folder Sync, click the Rules toolbar button (referee icon). In the Handling tab, make sure Sync empty folders is checked.
                  Chris K Scooter Software

                  Comment


                  • #10
                    Originally posted by Chris View Post
                    In Beyond Compare 4's Folder Sync, click the Rules toolbar button (referee icon). In the Handling tab, make sure Sync empty folders is checked.
                    I'm having the same issue here. The option you refer to, Chris, is also mentioned in the Help file, but it is not present in the UI. Well, at least I can't see it. I'm running BC v4.2.6.23150 64-bit. Please can you look into this? Thank you

                    Comment


                    • #11
                      Hello,

                      Could you double check the title bar if you are in the "Session Settings - Folder Sync" or "Session Settings - Folder Compare"? The Folder Sync session has this option, but the Folder Compare relies on the Folder View options (Always Show Folders, or Compare Files and Folder Structure) if the folder is still visible in the view for if it is included in the sync.
                      Aaron P Scooter Software

                      Comment


                      • #12
                        Thansk for getting back, below is what I'm looking at. I wasn't even aware of Folder Sync and up until now I've always used folder compare to successfully sync folders, so surely there is huge overlap between the two session types. What's the advantage of Folder Sync? I'm only a light user and I haven't explored all the features but I'll definitely look into folder sync.

                        I use folder compare is because I've set up a couple of hotkeys using AutoHotkey to select the left file/folder, and another one to select the right file/folder and open BC4 directly. This is much quicker than using shell menus and allows me to run BC4 portably.

                        Now, the help file says:

                        Mirror to Right: Replaces all different items on right, deletes any right-side orphans, and copies any left-side orphans to the right
                        So are orphans deleted or not? The fact that people come here asking why their orphans are not getting deleted surely indicates there's perhaps something counter-intuitive about the way this all works at the moment.

                        Attached Files
                        Last edited by Scoox; 24-Aug-2018, 09:15 PM.

                        Comment


                        • #13
                          The Folder Sync is a streamlined interface that only supports syncing. It is less powerful than the Folder Compare.

                          When using the Folder Compare to Actions > Synchronize > Mirror to Right, orphan files and folders on the right should be deleted. In the confirmation dialog for Synchronize, it might help to uncheck Just Selection.

                          If you do need to use Just Selection when syncing, make sure the left and right side are both selected. If Just Selection is checked and the right side isn't selected, right orphans will not be deleted.
                          Chris K Scooter Software

                          Comment


                          • #14
                            I also have a number of folders that are not deleted after a Mirror operation in Folder Sync. Even manually selecting to delete them in the UI and choosing 'Sync Now' does not remove them. The behavior is consistent with script operations. Some folders have system files in the folder like 'folder.jpg' which might cause a silent failure when deleting these files. Other folders just have empty sub-folders. I looked through the settings but cannot find any options for automatic deletion of system files or sub-folders. Is there some method to do this in Folder Sync or automatically with a script? I can remove the folders manually by selecting them a 'Folder Compare' result list but I really need the automation for backup syncing. Just updated to version 4.2.8 on Win10.

                            Comment


                            • #15
                              It might help to prevent Beyond Compare from filtering out system files. In the Folder Compare or Folder Sync, click the Rules button (referee icon). In the Other Filters tab, uncheck Exclude protected operating system files (Recommended), then click OK.
                              Chris K Scooter Software

                              Comment

                              Working...
                              X