I have a problem with the UPLOAD function of SYNC. The ftp server I am connecting to is running on MSDOS and will not accept the long filenames with the .part added extension. (this is what I deduct from the server output with default SETUPLOADMODE)
When switching to DIRECT UPLOADMODE it tries to overwrite the file with the direct filename, but then it sounds: error: File already exists.
Here is the feeback (VERBOSE(ON))
Default "SETUPLOADMODE":
[ScriptFTP]GETLIST
GETFILETIME(LOCAL)
GETFILETIME(REMOTE)
IF $BLA > $BLABLA
DELETEFILE
PUTFILE
END IF[/ScriptFTP]
Thank you for your advice!
Jonas
When switching to DIRECT UPLOADMODE it tries to overwrite the file with the direct filename, but then it sounds: error: File already exists.
Here is the feeback (VERBOSE(ON))
Default "SETUPLOADMODE":
SYNC("D:\BCS\Datafms\rcp","/rcp",UPLOAD)
CWD /rcp
250 CWD command successful
PWD
257 "/RCP/" is current directory
Clock time difference is -31600776 seconds.
Synchronizing remote directory /rcp from D:\BCS\Datafms\rcp. Ignoring subdirectories.
PASV
227 Entering Passive Mode (10,45,16,66,9,231)
Opening data connection to 10.45.16.66 Port: 2535
LIST
150 Sending file list
1078 bytes transferred. (13.4 KB/s) (78 ms)
226 Transfer complete
MDTM 1.RCP
213 20050524001100
Remote file time: 05/24/2005 00:11:00
Adjusted remote file time: 05/24/2006 18:10:36
Local file time: 02/28/2013 10:47:02
Uploading (remote file is older) 1.RCP
DELE 1.RCP.part
550 Bad file
PASV
227 Entering Passive Mode (10,45,16,66,9,29)
Opening data connection to 10.45.16.66 Port: 2333
STOR 1.RCP.part
550 Bad path
***** SYNC Error #17550: Cannot upload local file 1.RCP.
***** The server said: Bad path
SETUPLOADMODE(DIRECT)I am now considering to bypass this by using the below code, but I would prefer SYNC:
SYNC("D:\BCS\Datafms\rcp","/rcp",UPLOAD)
CWD /rcp
250 CWD command successful
PWD
257 "/RCP/" is current directory
Clock time difference is -31600776 seconds.
Synchronizing remote directory /rcp from D:\BCS\Datafms\rcp. Ignoring subdirectories.
PASV
227 Entering Passive Mode (10,45,16,66,8,125)
Opening data connection to 10.45.16.66 Port: 2173
LIST
150 Sending file list
1078 bytes transferred. (13.4 KB/s) (78 ms)
226 Transfer complete
MDTM 1.RCP
213 20050524001100
Remote file time: 05/24/2005 00:11:00
Adjusted remote file time: 05/24/2006 18:10:36
Local file time: 02/28/2013 10:47:02
Uploading (remote file is older) 1.RCP
PASV
227 Entering Passive Mode (10,45,16,66,9,219)
Opening data connection to 10.45.16.66 Port: 2523
STOR 1.RCP
553 File exists already
***** SYNC Error #17553: Cannot upload local file 1.RCP.
***** The server said: File exists already
[ScriptFTP]GETLIST
GETFILETIME(LOCAL)
GETFILETIME(REMOTE)
IF $BLA > $BLABLA
DELETEFILE
PUTFILE
END IF[/ScriptFTP]
Thank you for your advice!
Jonas
Hello Jonas,
Thanks for posting here. I modified the script you posted but I think it will not work as good as SYNC. The problem is that it does not handle the clock time difference that may exist between the the computer where ScriptFTP is running and the FTP server.
Another way that might work is comparing the file sizes. If you are sure that in your case a newer file always implies a different file size you can use this one:
Thanks for posting here. I modified the script you posted but I think it will not work as good as SYNC. The problem is that it does not handle the clock time difference that may exist between the the computer where ScriptFTP is running and the FTP server.
FTP Script
- # Get the file listing
- # For each remote file
FTP Script
- # Get the file listing
- # For each remote file
liked Script FTP? Try our other product Email Parser
I noticed the problem of time difference indeed. I fixed it by making a timesync, but is is only 99%.
I will let it run on filesize for a while to see where it goes.
EDIT: The FTP server won't accept the SIZE command, so I am back to the time for now. The fault is with the ftp server.
Thanks!
Jonas
I will let it run on filesize for a while to see where it goes.
EDIT: The FTP server won't accept the SIZE command, so I am back to the time for now. The fault is with the ftp server.
Thanks!
Jonas
Thanks for the update Jonas
liked Script FTP? Try our other product Email Parser