Script

FTP

The professional tool to automate FTP, SFTP, FTPS

and schedule FTP batch jobs

MENU MENU
Post a message here if you find anything wrong in ScriptFTP.
Hi,

it seems that CHMOD does not returns OK even when the FTP server gives a positive result:

Snippet from my script
Code: Select allIF(PUTFILE($DestFile) != "OK") DELETEFILE($DestFile) CLOSEHOST EXIT(2) ELSE CHMOD(777,$DestFile) EXEC("del /Q ".$DestFile) END IF  
gives this verbose log:

Code: Select allPUTFILE("orders_wave_20090129_080525") Uploading.................      orders_wave_20090129_080525 DELE orders_wave_20090129_080525.part 550 orders_wave_20090129_080525.part: No such file or directory. PASV 227 Entering Passive Mode (139,3,211,9,196,95) Opening data connection to 139.3.211.9 Port: 50271 STOR orders_wave_20090129_080525.part 150 Opening ASCII mode data connection for orders_wave_20090129_080525.part. 40119 bytes transferred. (167 KB/s) (234 ms) 226 Transfer complete. DELE orders_wave_20090129_080525 550 orders_wave_20090129_080525: No such file or directory. RNFR orders_wave_20090129_080525.part 350 File exists, ready for destination name. RNTO orders_wave_20090129_080525 250 RNTO command successful. CWD /usr/sap/ex/prod/P11/skp/zos 250 CWD command successful. PWD 257 "/usr/sap/ex/prod/P11/skp/zos" is current directory. CHMOD("777","orders_wave_20090129_080525") PASV 227 Entering Passive Mode (139,3,211,9,40,153) Opening data connection to 139.3.211.9 Port: 10393 LIST 150 Opening ASCII mode data connection for /usr/bin/ls. 161 bytes transferred. (1,00 KB/s) (157 ms) 226 Transfer complete. Applying Unix file attributes for........ /usr/sap/ex/prod/P11/skp/zos/orders_wave_20090129_080525 SITE CHMOD 777 orders_wave_20090129_080525 200 CHMOD command successful. ***** CHMOD Error #12006 : File "orders_wave_20090129_080525" not found. EXEC("del /Q orders_wave_20090129_080525")  
You can see from log that the file exists on server side and the server responds to site chmod with an 'OK' status. Nevertheless ScriptFtp reports an error code.

If you use CHMOD with wildcards:
Code: Select allCHMOD(777,orders_wave_*)  
you get also a log entry, but without error code (as wildcards can result in no files present):
Code: Select allCHMOD("777","orders_wave_*") PASV 227 Entering Passive Mode (139,3,211,9,99,76) Opening data connection to 139.3.211.9 Port: 25420 LIST 150 Opening ASCII mode data connection for /usr/bin/ls. 248 bytes transferred. (7,56 KB/s) (32 ms) 226 Transfer complete. Applying Unix file attributes for........ /usr/sap/ex/prod/P11/skp/zos/orders_wave_20090128_080853 SITE CHMOD 777 orders_wave_20090128_080853 200 CHMOD command successful. No file matches the wildcard.  

Regards,

Christian
Hi!

Yes works now, no more error messages in log.... thx again for quick response and a great tool!!!!

Best Regards,

Christian