SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
batch file with ftp script failing

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
batch file with ftp script failing
Author Message
kangko



Joined: 05 Feb 2010
Posts: 6
Country: United States

Post batch file with ftp script failing Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
Is this running as a service?
If yes, is this running under LocalSystem account?
Fri Feb 05, 2010 12:36 pm View user's profile Send private message
kangko



Joined: 05 Feb 2010
Posts: 6
Country: United States

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
kangko



Joined: 05 Feb 2010
Posts: 6
Country: United States

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
kangko



Joined: 05 Feb 2010
Posts: 6
Country: United States

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
kangko



Joined: 05 Feb 2010
Posts: 6
Country: United States

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
Thank you for the status update.
Fri Feb 12, 2010 1:57 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.