Script

FTP

The professional tool to automate FTP, SFTP, FTPS

and schedule FTP batch jobs

MENU MENU
Post here if you experience file transfer problems or unexpected errors.
On a sync operation it is calculating a clock time difference of 5 hours between the server and client. However both servers are set to the same time and time zone. As a result, it is taking 5 hours before new files are synchronized.

From the console when I run my script
SYNC("<removed path>","<removed path>",DOWNLOAD)
Uploading temporary file to calculate server-client clock time difference.
Clock time difference is 17999 seconds.
Still haven't been able to determine why ScriptFTP thinks there's a 5 hour difference. Any ideas of what might be going wrong would be appreciated.
Try manually setting the clock time difference as zero with SETCLOCKDIFF(0)

This may happen because your FTP server returns UTC time instead of local time, but if this would be the case the file synchronizations should work fine even when a 5 hours difference is reported. Very strange...

Post here the verbose output ( use VERBOSE(ON) ) to see exactly what is happening
Sorry for taking a while to try out the verbose output. Here it is:
SYNC(<local path removed>,"/large",DOWNLOAD)
CWD /large
250 CWD successful. "/large" is current directory.
PWD
257 "/large" is current directory.
Uploading temporary file to calculate server-client clock time difference.
TYPE I
200 Type set to I
PORT <IP and port removed>
200 Port command successful
STOR ScFB3FB.tmp
150 Opening data channel for file transfer.
74 bytes transferred. (N/A/s) (0 ms)
226 Transfer OK
MDTM ScFB3FB.tmp
213 20131216174709
Remote Time: 12/16/2013 17:47:09
Remote Time: 12/16/2013 12:47:09
DELE ScFB3FB.tmp
250 File deleted successfully

Clock time difference is 17999 seconds.
Yes, it seems that your FTP server is returning UTC +0 time. You have to set the clock time difference manually with SETCLOCKDIFF(0)

Thanks for posting the details.
I'm having a similar issue with setting the clock time difference.

STOR ScFAB58.tmp
150 Opening data channel for file upload to server of "/ScFAB58.tmp"
74 bytes transferred. (948 bytes/s) (78 ms)
226 Sucessfully transferred ""
MDTM ScFAB58.tmp
213 20140510141828
Remote Time: 05/10/2014 14:18:28
Remote Time: 05/10/2014 10:18:28
DELE ScFAB58.tmp
550 Permission denied
Clock time difference is 14399 seconds.
Setting the time difference manually to 0 or 14399 doesn't help, the script will still redownload all of the files from the last 4(?) hours or so.

With SETCLOCKDIFF(14399) I get this result
Remote file time: 05/10/2014 14:37:41
Adjusted remote file time: 05/10/2014 14:41:04
Local file time: 05/10/2014 10:47:27

and then I run it again a couple of minutes later with SETCLOCKDIFF(0):
Remote file time: 05/10/2014 14:37:41
Adjusted remote file time: 05/10/2014 14:37:41
Local file time: 05/10/2014 10:51:03

I also get this result with SETCLOCKDIFF(14399)
FTP Script
  1. SETCLOCKDIFF("14399")
  2. Server-client clock time difference manually set to 14399 seconds.
  3.  
  4. SYNC("Path Removed")
  5. CWD /
  6. 250 CWD successful. "/" is current directory.
  7. PWD
  8. 257 "/" is current directory.
  9. Clock time difference is -203 seconds.