Hello,
I have an upload script, that uploads certain files, and after uploading it deletes the file that is uploaded (from $List)
The upload goes well, but the deleting process not quite, it actually deletes the file from the FTP, whilst it should delete it locally.
What goes wrong here? Look to the upload/delete script below.
I have an upload script, that uploads certain files, and after uploading it deletes the file that is uploaded (from $List)
The upload goes well, but the deleting process not quite, it actually deletes the file from the FTP, whilst it should delete it locally.
What goes wrong here? Look to the upload/delete script below.
FTP Script
- # Get the local file listing, store it in $list
- # If GETLIST failed stop the script
- # For each file in $list...
- # Upload the file
- # If the file has been succesfully uploaded
- # delete the local copy of the file
Thanks for your reply
That seemed indeed to be the issue, I found that last night as well and edited that.
It seems to work just fine, however I do wonder if I should worry about the log output scriptFTP gives(see red print):
That seemed indeed to be the issue, I found that last night as well and edited that.
FTP Script
PUTFILE("A_20120119_0224278.edi")The files do disappear locally though, so looks like it works, but maybe I've done something silly in the code what actually causes this.
Uploading................. A_20120119_0224278.edi
DELE A_20120119_0224278.edi.part
550 File not found
PASV
227 Entering Passive Mode (xxx,xx,xx,xx,14,23)
Opening data connection to xxx.xx.xx.xx Port: 3607
STOR A_20120119_0224278.edi.part
150 Connection accepted
324 bytes transferred. (19,7 KB/s) (16 ms)
226 Transfer OK
DELE A_20120119_0224278.edi
550 File not found
RNFR A_20120119_0224278.edi.part
350 File exists, ready for destination name.
RNTO A_20120119_0224278.edi
250 file renamed successfully
CWD /EDI/send/import
250 CWD successful. "/EDI/send/import" is current directory.
PWD
257 "/EDI/send/import" is current directory.
EXEC("del A_20120119_0224278.edi")
_____All done, closing connection_____
Could you post your entire script?
There must be lines missing as the script you have shown cannot possibly produce the log output.
There must be lines missing as the script you have shown cannot possibly produce the log output.
Sure, this is the complete script, blurred out some info obviously and left out some commentary.
FTP Script
- # Set system variables
- # -- enable this line (and disable one above by ##) if you want to see extended date & time :
- ## $date=GETDATE(YEAR).GETDATE(MONTH).GETDATE(DAY)."_".GETDATE(HOUR).GETDATE(MIN).GETDATE(SEC)
- # my variables
- $log_dir="D:\EDIGAS logging\LOGFILES"
- $log_file=$log_dir."\EDIGAS Upload_".$date.".log"
- # Start logging
- VERBOSE(ON)
- # Connect to EDIGAS FTP
- # If OPENHOST failed, stop the script
- # Change working directory
- # If LOCALCHDIR failed stop the script
- # Get the local file listing, store it in $list
- # If GETLIST failed stop the script
- # For each file in $list...
- # Upload the file
- # If the file has been successfully uploaded
- # delete the local copy of the file
- # Close the connection
- All times are UTC -