Transfer script only works when manually executed

Advertisement

Phane
Guest

Transfer script only works when manually executed

I have a transfer script with the command line :

"c:\PATHTOWINSCP\winscp.com" /ini=nul /script="c:\PATHTOSCRIPT\SCRIPT.txt" /parameter %1 >> "c:\PATHTOWORKINDIR\%~n1.log"

The script.txt file reads :

option batch abort
option confirm off
open ftp://LOGIN:PW@FTP.SITE
put "%1%" "ULDIR/"
exit

Whenever I execute this from a batch file, it works properly. Whenever it is executed as a service or as a .bat file set to run as a scheduled task, it fails.

The LOG for a failed UL is as follows:

batch           abort     
confirm         off       
Connecting to FTP.SITE ...
Connected with FTP.SITE. Waiting for welcome message...
Connected
Starting the session...
Reading remote directory...
Session started.
Active session: [1] LOGIN@FTP.SITE
C:\PATHTOWORKINGDIR\FILE.mpg |    5141296 KiB |  202.3 KiB/s | binary |  99%
Lost connection.
Timeout detected.

Copying files to remote side failed.
(A)bort, (R)econnect (5 s): Reconnect
Connecting to FTP.SITE ...
Connected with FTP.SITE. Waiting for welcome message...
Connected
Starting the session...
Reading remote directory...
Session started.
C:\PATHTOWORKINGDIR\FILE.mpg |    5141336 KiB |    0.0 KiB/s | binary | 100%batch           abort     
confirm         off       
Connecting to FTP.SITE ...
Connected with FTP.SITE. Waiting for welcome message...
Connected
Starting the session...
Reading remote directory...
Session started.
Active session: [1] LOGIN@FTP.SITE
C:\PATHTOWORKINGDIR\FILE.mpg.txt |          774 B |    0.0 KiB/s | binary |

Logs on the FTP don't show a successful login or anything, they just show :

SEP 20 05:00:48 FTP server: logout

Normally it SHOULD show :

   Sep 20 11:42:05 FTP server: USER Logout
   Sep 20 11:42:05 FTP server: USER Logout
   Sep 20 11:42:03 FTP server: /ULDIR/TESTFILE.txt uploaded (144 bytes, 72.71KB/sec)
   Sep 20 11:42:03 FTP server: allowed flag: 1
   Sep 20 11:42:03 FTP server: [pure-ftpd]: ftpd.c, dostor(4925): ftp store file name:TESTFILE.txt
   Sep 20 11:42:03 FTP server: USER user logged in from IPADDRESS
   Sep 20 11:41:39 FTP server: USER user logged in from IPADDRESS

Any suggestions as to what is causing this to fail? Also, I should note that despite the log file looking like it might have succeeded in uploading, it hasn't. No file shows up. If I check the drive when it's supposed to be uploading, nothing is there.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,671
Location:
Prague, Czechia

Re: Transfer script only works when manually executed

Please attach a complete log file showing the problem (the c:\PATHTOWORKINDIR\%~n1.log, not console output). Also a log file from a successful session would help for comparison.
_________________
Martin Prikryl

Reply with quote

Phane
Joined:
Posts:
2

Re: Transfer script only works when manually executed

martin wrote:

Please attach a complete log file showing the problem (the c:\PATHTOWORKINDIR\%~n1.log, not console output). Also a log file from a successful session would help for comparison.

The OP had the entire content of the .log file and it is nothing but console output by nature given it was created with a redirect.

If you need me to post a log of a successful transfer, I can, but it'd still be just console output unless I'm missing some other way of creating a log that ISN'T just a redirect.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,671
Location:
Prague, Czechia

Re: Transfer script only works when manually executed

Sorry, I've misunderstood your command. Please add /log=path_to_log command-line parameter and attach the log.
_________________
Martin Prikryl

Reply with quote

Phane
Joined:
Posts:
2

I updated my NAS's firmware (DNS-320) from 2.03 to 2.05b8 and that seems to have resolved the issue. Although I'm still not certain why it was working on the client side when manually executed and not working when it was run as a service or scheduled task. In any case, it is working under all three situations since the server side update. There weren't any release notes associated with the new firmware so no one knows for sure what they changed.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,671
Location:
Prague, Czechia

Thanks for your feedback.
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum