Differing Date/Time after FTP Sync

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RobbDye
    New User
    • Mar 2008
    • 2

    Differing Date/Time after FTP Sync

    Hi,

    I have a Beyond compare script that pulls files from a remote server using FTP. After syncing I find that files created/updated by beyond compare on local server (running BC script) are time-stamped several hours in the future of the actual file date/time.

    Both servers involved are set to Mountain Daylight Time

    Beyond Compare version: 2.4.3 (build 243)
    script example:

    criteria timestamp:180sec size
    option stop-on-error
    load "ftp://(user)pass)@(server/SCO_WebUI/SupplementalDocuments/Database/Cases" "C:\Data\DbScripts"
    expand all
    folder-report layout:side-by-side &
    options:display-mismatches &
    output-options:html-color &
    output-to:"reports\ShipCompliantV4\BeyondCompare\folder_c ompare_%date%_%fn_time%.html"
    sync create-empty update:lt->rt
    beep

    Any Insight?
    Thanks!
  • Aaron
    Team Scooter
    • Oct 2007
    • 16026

    #2
    Re: Differing Date/Time after FTP Sync

    Hi,

    The first couple of things to try are:

    -Upgrade to the newest version of BC (currently 2.5.2) available here:
    http://www.scootersoftware.com/download.php
    All 2.x upgrades are free for 2.x users. This is assuming your IT dept would be ok with the upgrade.

    -Try to run interactively from the program. Does that also have the dates appear off?

    Are the timestamps of the files exactly a certain time in the future (based from the original timestamp, or the time of transfer)?

    You also probably want to add a log command to help troubleshoot:
    log verbose append:"c:\website updates.txt"
    near the top of your script
    Aaron P Scooter Software

    Comment

    • REHAKES
      Visitor
      • Sep 2008
      • 3

      #3
      Most FTP servers set the date/time stamp to the actual date and time that the file was uploaded to the server. (There is a FTP command to set the copied file date and time to that of the source file, but few FTP servers support it, and those that do, don't do it in a uniform manner. Microsoft's FTP Server that's native to Windows Server doesn't.) So, if the files are copied up to a FTP server as a result of a Beyond Compare comparison, the files just copied will have a date and time that's newer than the original file. Beyond Compare 2 has a neat feature that will re-set the date and time of the source file to match that of the newly uploaded file. That way, the next compare will show the source being newer if the source file is actually modified after that upload, even if the file is modified only shortly after the upload.

      I'm not sure that feature is in Beyond Compare 3, but I'm hoping it is!

      Bob Hakes

      Comment

      • Michael Bulgrien
        Carpal Tunnel
        • Oct 2007
        • 1772

        #4
        Yes, Bob, this feature is supported in BC3 as well.

        If you are interacting with an FTP site that does not support touching date/time stamps and does not preserve date/time stamps on upload, you can have BC3 touch the local file as follows:

        Go to the Handling tab under Session Settings and check the "Touch local files when copying to an FTP site" checkbox. If you want to make this your default setting, choose "Also update session defaults" in the session settings context drop-down box before clicking OK.
        Last edited by Michael Bulgrien; 04-Sep-2008, 08:00 AM.
        BC v4.0.7 build 19761
        ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

        Comment

        • MarkBorcherding
          New User
          • Jan 2009
          • 1

          #5
          Wrong Dates After Sync

          We're trying to sync via script and are unable to either ignore the timezone differences or keep the local times of the file after FTP to a server in the same timezone.

          We're trying:
          criteria timestamp:IgnoreDST size timezone:ignore

          And we still see diffs where there timezone is off by exactly 6 hours.

          This throws an error about the timezone parameter being invalid.
          criteria timestamp:IgnoreDST size timezone:left+6

          I see the TOUCH command, but not sure exactly where that goes. Does it go after the SYNC?

          Here is our entire script as it is now.
          -----------------------------------------------------
          log normal "%3\deployment.log.txt"
          criteria timestamp:IgnoreDST size timezone:ignore

          load "%1" "%2"

          expand all
          select all
          filter "*.*"

          sync create-empty mirror:lt->rt
          -----------------------------------------------------

          Any advice on how to keep the dates of the files in sync

          Comment

          • Zoë
            Team Scooter
            • Oct 2007
            • 2666

            #6
            Hi Mark,

            To adjust the timezone you should load the comparison interactively then use the Tools->FTP Profiles dialog. On the "General" tab in that dialog is a "Time zone" dropdown. Try changing it from the default "Auto detect / Use Server Time" to either "UTC" or the timezone the server is in. You'll need to refresh the comparison afterwards for it to take effect. That doesn't change anything on the server; it just controls how BC interprets the timestamps that it gets in the directory listings and how it adjust the timestamps when it touches files. It isn't possible to adjust the timezone within a script, so you'll either need to run the script under the same user you loaded the interactive session with, or copy BCFtpProfiles.xml from your AppData directory to the corresponding one that your script uses.

            If you do decide to use the touch command it should go after the sync.
            Zoë P Scooter Software

            Comment

            • jonashogstrom
              New User
              • Jan 2005
              • 2

              #7
              Originally posted by Craig
              Hi Mark,

              To adjust the timezone you should load the comparison interactively then use the Tools->FTP Profiles dialog. On the "General" tab in that dialog is a "Time zone" dropdown. Try changing it from the default "Auto detect / Use Server Time" to either "UTC" or the timezone the server is in. You'll need to refresh the comparison afterwards for it to take effect. That doesn't change anything on the server; it just controls how BC interprets the timestamps that it gets in the directory listings and how it adjust the timestamps when it touches files.
              I have tried to get the ftp profile setting to work, but no matter what I set hte timezone to, BC (3.1.4) displays the same date. How do I get BC to understand that it should use the setting in the profile? I'm using a saved session with the same server name as the value in the ftp profile.

              Comment

              • Zoë
                Team Scooter
                • Oct 2007
                • 2666

                #8
                Without seeing a log I can only guess, but it's likely that your server is incorrectly supporting the MLSD command. MLSD is always supposed to return UTC timestamps, so BC doesn't use the timezone setting in that case. You should be able to work around it by unchecking the "Use MLSD command" option on the "Listings" tab of the profile.
                Zoë P Scooter Software

                Comment

                • jonashogstrom
                  New User
                  • Jan 2005
                  • 2

                  #9
                  Wonderful. That solved my problem! Many thanks!

                  Comment

                  Working...