ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Post here if you experience file transfer problems or unexpected errors.
I'm having an issue with script ftp stopping the sync when it hits a file that is being used by another process iam looking for a way to skip these files and continue the transfer.

[scriptftp="synchronize.ftp"]#Change the Default FTP Port
SETPORT(8081)

#Disable Passive FTP Mode
#SETPASSIVE(Disabled)

# Connect to FTP server
OPENHOST("123.123.123.123","myuser","mypassword")

#Get Current Date & Time
$date=GetTime()

#Build Logfile Name
$logfile="C:\backup\FTPLogs\SyncLogs-".$date.".log"

#Start Logging
LogTo($logfile)

#Set Clock Difference
#SETCLOCKDIFF(3600)

# Sync the Local Directory with the Cloud (Will deleted files that no longer exist at source)
SYNC("c:\","/C_drive",UPLOAD_DELETE,SUBDIRS)

# Sync the Local Directory with the Cloud (Will deleted files that no longer exist at source)
SYNC("D:\","/D_drive",UPLOAD_DELETE,SUBDIRS)

# Transfer finished, close the connection
CLOSEHOST[/ScriptFTP]
If the file is usually the same try using the ADDEXCLUSION command to exclude that file from the syncronization:

http://www.scriptftp.com/reference.php?go=topic70

If not I suggest you to retry the SYNC process in the case it stops syncronization because of that. It would be something like the following:

[scriptftp="retry_synchronization"]:retry_sync
$result=SYNC("c:\","/C_drive",UPLOAD_DELETE,SUBDIRS)

IF($result!="OK")
goto :retry_sync
END IF[/ScriptFTP]

You can be even more specific and retry the syncronization if the error that found SYNC is only related to the problem you described. Let's asume that ScriptFTP returned in this case the error "12043":

[scriptftp="retry_synchronization"]:retry_sync
$result=SYNC("c:\","/C_drive",UPLOAD_DELETE,SUBDIRS)

IF($result!="12043")
goto :retry_sync
END IF[/ScriptFTP]

This way if, for example, SYNC fails simply because the connection failed, SYNC will not be relaunched.