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 :
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:
Logs on the FTP don't show a successful login or anything, they just show :
Normally it SHOULD show :
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.
"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.