Author |
Message |
kangko
Joined: 05 Feb 2010 Posts: 6 Country: United States |
|
batch file with ftp script failing |
|
I have a simple batch file that downloads and moves some files to another server. When running the batch from 24x7, I'm getting an error "Process finished with exit code 128". Stepping through the batch file shows that the ftp command is not executing. The command in the batch file and the called ftp script file are below. I'm open to using JAL instead of the batch, but I need to be able to do mget and mdelete and I don't see commands that will do that in the user manual. I am running 24x7 Scheduler v3.6.5.
FROM BATCH
FTP -d -n -i -s:E:\Scripts\ftpscript.ftp >E:\Scripts\Logs\ftpscript.log
FROM FTP SCRIPT
open <ftpserver>
user <user> <pw>
cd CB
lcd E:\Scripts\Temp
MGET *.xml
MDELETE *.xml
close
bye
|
|
Fri Feb 05, 2010 12:20 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
Is this running as a service?
If yes, is this running under LocalSystem account?
|
|
Fri Feb 05, 2010 12:36 pm |
|
 |
kangko
Joined: 05 Feb 2010 Posts: 6 Country: United States |
|
|
|
Yes, it's running under a domain acct. I've given the account permission to run as a batch and the Scheduler service acct rights to act as the OS and create and replace tokens. Other commands in the batch file, specifically file copy and delete commands, are executing.
|
|
Fri Feb 05, 2010 2:54 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
The described permissions have nothing to do with the FTP.
Please verify that E:\ is not a mapped network drive. Services and any apps started from services cannot you your existing drive mappings.
If drive mappings is not the case then the domain account used for the service is not allowed to go outside of the box. I'm pretty sure, if you start the scheduler as an interactive application in your own user session, the scheduled FTP script will run just fine.
|
|
Fri Feb 05, 2010 3:58 pm |
|
 |
kangko
Joined: 05 Feb 2010 Posts: 6 Country: United States |
|
|
|
It's a local drive, not a networked drive.
I did 2 things that resolved the problem and may have found a bug. I gave the runas account local admin privileges which resolved any permission issues. I was no longer getting any errors or warnings, but the actual ftp download wasn't executing. By chance, I unselected the SMTP start and finish notification that I had selected when creating the job and the job then worked. I tested re-selecting the SMTP notifications and the job would "fail", no error, but no file downloaded. After clearing the SMTP flags, it has now worked without error over the weekend. I know this sounds rather unusual, but I'll be willing to demonstrate if you can do a remote session. Ultimately, I do need SMTP notifications to work.
|
|
Mon Feb 08, 2010 11:22 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
It fails because it is unable to send email messages and as a result the job execution gets aborted. Please review your firewall/antivirus settings to ensure emails can be sent from this program using SMTP protocol.
|
|
Mon Feb 08, 2010 2:59 pm |
|
 |
kangko
Joined: 05 Feb 2010 Posts: 6 Country: United States |
|
|
|
I should have stated in my earlier post that SMTP is working. I get the start and stop e-mails, but the batch command to download via ftp "fails". In the same batch file, I have copy commands that do execute. I will be happy to demonstrate it for you.
|
|
Mon Feb 08, 2010 3:41 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
Are you saying that if the start/finish emails are not sent, the FTP batch runs fine. If emails are sent, the batch breaks?
Do I get it correctly?
Would you please retest it and confirm you can reproduce that?
|
|
Mon Feb 08, 2010 4:54 pm |
|
 |
kangko
Joined: 05 Feb 2010 Posts: 6 Country: United States |
|
|
|
I wanted to provide an update. I wasn't able to reproduce the error, so I can't confirm the problem with SMTP. Thanks for your help.
|
|
Fri Feb 12, 2010 1:20 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
Thank you for the status update.
|
|
Fri Feb 12, 2010 1:57 pm |
|
 |
|