I would like to share with the forum a question I received by email. I reproduce it here with the permission of the user.
I am doing a FTP sync with around 20 Gb of data. for some reason its timing out and not finishing. there are 5 root folders, lots of folders inside. I have broken the script in to 5 connections with a sync for each folder. but i am still having the same issue. does work some what.. just never finishes.
or is there any other option without syncing the entire remote directory, to grab new files, maybe based on date modified. like download all files newer than a date?
thanks
any help would be great.
***** SYNC Error #16023: Connection closed.
***** CLOSEHOST Error #18001: Not connected.
***** SYNC Error #16004: Operation timed out.
***** CLOSEHOST Error #18001: Not connected.
***** SYNC Error #16023: Connection closed.
***** CLOSEHOST Error #18001: Not connected.
***** SYNC Error #16004: Operation timed out
liked Script FTP? Try our other product Email Parser
My reply here:
[scriptftp="retry_synchronization.ftp"]:point1
# Connecto to FTP server
OPENHOST("ftp.test.com","mysuer","mypasswd")
# Synchronize files
$result=SYNC("C:\localfolder","/remotefolder",DOWNLOAD,SUBDIRS)
# If SYNC returned a connection closed(16023) error
# or a operation timed out error (16004) retry
IF($result=="16023" OR $result=="16004")
GOTO :point1
END IF[/ScriptFTP]
You can relaunch SYNC if it didn't worked. Beware that if SYNC never finishes correctly this script may run forever. I suggest you to keep your script in 5 different parts and add this to each part:
[scriptftp="retry_synchronization.ftp"]:point1
# Connecto to FTP server
OPENHOST("ftp.test.com","mysuer","mypasswd")
# Synchronize files
$result=SYNC("C:\localfolder","/remotefolder",DOWNLOAD,SUBDIRS)
# If SYNC returned a connection closed(16023) error
# or a operation timed out error (16004) retry
IF($result=="16023" OR $result=="16004")
GOTO :point1
END IF[/ScriptFTP]
liked Script FTP? Try our other product Email Parser