Topic "Transfer script only works when manually executed"

Author Message
Phane

Guest


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 :

Code:
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:

Code:
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 :

Code:
SEP 20 05:00:48 FTP server: logout


Normally it SHOULD show :

Code:

   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.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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
Phane
[View user's profile]

Joined: 2014-09-20
Posts: 2
prikryl 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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Sorry, I've misunderstood your command. Please add /log=path_to_log command-line parameter and attach the log.
_________________
Martin Prikryl
Phane
[View user's profile]

Joined: 2014-09-20
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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Thanks for your feedback.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License