I am trying to transfer logs from Aix 6.1 to a linux appliance but it is not happening from last one month if i execute the batch command by command i can execute well but if i do it in shell script it is stuck without any error.
Any one know how to generate a FTP client trace to know the issue with FTP batch file.
---------- Post updated 03-02-14 at 11:53 AM ---------- Previous update was 03-01-14 at 01:30 PM ----------
Sorry not my intention to play tricks but i am really need of suggestion since this issue has taken my sleep and peach of mind away.
Please find below my answers to your query.
This is a fresh script.
We are able to send the logs manually by keying the same commands in the script
This is FTP
pls find the script at the end.
manually i am able to use mput command and at destination is see logs transferred but schedule sends the logs once and freezes then.
job is scheduled through cronjob every 10 minutes and the log file size is around 20 mb.
the script freezes at execution without any error
I do not know how to check error on a linux box since the server is a RHEL appliance
Credentials are not the problem here.
Password is fine and works when keyed in manually.
If this is a shell script it should be in an executable file with a line at the shebang at the top. Like this:
#! /usr/bin/ksh
echo I am a script
exit 0
I have the uncomfortable feeling that you are trying to put all of this code directly in your crontab file. That is not a great idea. Also I can look at the shebang line and instantly see that I am dealing with a ksh script. We have to guess about what shell you are using.
Don't run an external cd program. This the most useless thing that Posix has done. "/usr/bin/cd /usr" will not change the script's current directory. You must use the shell's built-in cd command for that.
You might want to consider switching to YYYYMMDDHHMM as you name your log files. They will sort in chronological order that way.
So a few things, now that I've looked a second time.
You don't need the /usr/bin/cd /usr line at all. You give the full paths everywhere else in your script.
Did you replace the ftp command with the suggestion from Chubbler_XL What output do you now get in the log file?
Perhaps you have typed your quotes correctly here, but they might be incorrect in your script. On the line to copy the file, you have a pair of back-quotes ` so it should run the data command. I've pasted your command onto my AIX server and it runs fine. Perhaps in your script you have used normal single quotes '
Try duplicating the line and displaying it before executing, i.e.:-
I've spaced it out to make it a little easier to read. Can you try running with that and tell us what you see. I can see two things that seem a bit odd, but rather than leap in and tell you, it would be better for you to have a go yourself.
Good luck. Let us know how you get on. Do ask for help if you see messages that you don't understand.
Thanks to Chubber,Robin,ahmed,Perderabo for the help.
This my first Aix system i was also not sure how it was working without the first shell extension #! /usr/bin/ksh .
Coming to the error actually i was putting stream.out* in my script thats the reason the script was not working.After removing multiple files from the source dir and/or removing the * the error went away.And the script was successful.
Thank you to all and apologies for not posting the updated code.