Auto Sync in Folder Sync

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aaron
    Team Scooter
    • Oct 2007
    • 16000

    #16
    Hello,

    You must still load a Folder Compare, which can cover all of the sync cases in script, but is a bit trickier to setup. Instead of using the Sync:Update or Mirror commands, you instead use a series of selection and copy/delete commands to achieve the same actions as the sync.

    What is your current Folder Sync session configured to perform? We can then help with a script that would perform the same series of actions.

    It is important to remember that script is executed sequentially. You can have multiple select and copy commands, in order of execution.
    expand all
    select right.older.files
    copyto base "c:\backup"
    select left.newer.files
    copy left->right
    Last edited by Aaron; 08-Jan-2013, 10:41 AM. Reason: Script is sequential
    Aaron P Scooter Software

    Comment

    • cacchip
      New User
      • Apr 2014
      • 2

      #17
      Sync to FTP via command line

      I am syncing to an FTP site and that causes issues with the dates on the files. My current command is this
      load "admin"
      sync mirror:left->right
      but the local files are now much older than the remote files because the ftp site doesn't maintain the date. This causes a prompt to ask about overwriting. I see from the last message that it can be broken out like this
      expand all
      select left.newer.files
      copy left->right

      How would I remove files on the right that have been deleted on the left for a true sync?
      Thanks

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16000

        #18
        Hello,

        You can select right.orphan.files then delete right, but since script does not offer any preview or Undo, I recommend testing on test folders first to prevent losing any live data.

        However, I'm not sure that's the best solution. If the dates are not maintained on the server automatically, you could perform a Touch manually after the copy (in either direction) to re-set the date. This can be done with another select command (perhaps after a binary compare, then select all.equal.files?), then using the touch command. For details on the syntax, please see the Help file -> Scripting Reference.

        In the session "admin" in the graphical interface, in the Session Settings, Handling tab, we do have an option to automatically set the timestamps of the local files from the server (for servers that do not support maintaining or setting the timestamp). If this option is enabled in the Session, it would be loaded in the script as well. This would keep the timestamps in sync (although newer).

        I would recommend stepping through the graphical interface first, to determine which steps/logic you'd like to use. This way you can visually see the comparison and how each script command would then interact (as each command generally resolves to a specific click or selection in the graphical interface).
        Aaron P Scooter Software

        Comment

        Working...