AIX FTP client


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting AIX FTP client
# 8  
Old 03-04-2014
Something like this
Code:
file_name="/logs/AIX1."$( date +%H%M%d%m%Y )
cp -p /usr/stream.out $file_name

Make sure you have all the directories like /log and the file you are trying to copy.
Also make sure the path of the commands are correct.

If it still doesn't work, past the output of your script with -x i.e. bash -x your_script

--ahamed
# 9  
Old 03-04-2014
A few suggestions...

If this is a shell script it should be in an executable file with a line at the shebang at the top. Like this:
Code:
#! /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.
# 10  
Old 03-05-2014
ra8ul,

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.:-
Code:
echo "**************************************************************" >> /usr/Mac.log
/usr/bin/date >> /usr/Mac.log

echo /usr/bin/cp -p /usr/stream.out /logs/AIX1.`/usr/bin/date +%H%M%d%m%Y` >> /usr/Mac.log 2>&1
/usr/bin/cp -p /usr/stream.out /logs/AIX1.`/usr/bin/date +%H%M%d%m%Y` >> /usr/Mac.log 2>&1

/usr/bin/ftp -n -i "ipaddress" >> /usr/Mac.log 2>&1 <<EOF
user ftpuser password
lcd /usr
cd Aix
prompt
mput AIX*
quit
EOF

mv /usr/AIX* /usr/archived/
echo "finish" >> /usr/Mac.log

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.



Robin
# 11  
Old 03-05-2014
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Yum not working on client while able to do the ftp

1)check vsftpd service is running service vsftpd status 2)mkdir -p /var/ftp/pub/Packages Packages will contain all rpm packages 3)copy the xml file to Packages folder #cp -arf /mnt/hgfs/share/RHEL_DVD/Packages /var/ftp/pub/Packages 4)install the 3 required rpm rpm --nodeps -ivh... (0 Replies)
Discussion started by: joj123
0 Replies

2. Red Hat

Implement FTP server on RHEL server without using FTP client

We have RHEL 5.8 in our environment, I had a query whether we can implement an FTP server using vsftpd package and Linux configurations like setsebool without using any external FTP clients like FileZilla etc. I am very confused on this. The FTP functionalities that should be present are download &... (3 Replies)
Discussion started by: RHCE
3 Replies

3. Shell Programming and Scripting

FTP client is hanging very rarely!

Hi, I have a script in which I am using ftp to transfer some files from remote -> local and vice versa, this scripts is invoked by cron. for your reference I am sharing the function also : ============================================= fn_FileTransfer_LocalToRemote() { set -x... (1 Reply)
Discussion started by: anshuman0507
1 Replies

4. UNIX for Advanced & Expert Users

Dummy FTP Client!

We're just about to start testing a new server build. The application has many FTP/SFTP connections going to different servers. I'd like to temporarily replace the FTP/SFTP binaries with a mock version that will allow us to run all our production code as is, but will prevent the FTPs from actually... (1 Reply)
Discussion started by: JerryHone
1 Replies

5. Solaris

A good ftp client

Can anyone please suggest a agood ftp client(GUI) which would support sftp ...on solaris. I badly need it. I keep doing the transfers frequently, and some of them are binary and I am not sure how I change the mode to binary. To avoid this and other hassles, it would help if i have a GUI client. ... (6 Replies)
Discussion started by: Naanu
6 Replies

6. AIX

FTPS - FTP CLIENT- AIX - HELP Please

I'm currently investigating the secure ftp connection from AIX using shell script - It looks openssl is already install and don't know command to be used to connect the secure ftp server. 1. Do I need to install certificate on AIX ?. 2. If any one already design the script to connect secure... (0 Replies)
Discussion started by: dharanir
0 Replies

7. UNIX and Linux Applications

Secure FTP Client that Logs well

Folks I am on a quest.... I am looking for a lightweight FTP client capable of FTPS and or SFTP that has good audit and logging capabilities without requiring a central server component. My platforms are Linux, Solaris, AIX, and Windows Server. The kicker is I have found things that meet the... (3 Replies)
Discussion started by: ArtF
3 Replies

8. UNIX for Dummies Questions & Answers

FTP client that meets these requirements?

Hi All, Does anyone knows an FTP client that meet these basic requirements? -Runs in the console therefore not a gui based but a command line based like the normal ftp program. -auto detects ascii / binary format files. -runs in linux. -free and opensource. Filezilla should be fine but... (3 Replies)
Discussion started by: 3rr0r_3rr0r
3 Replies

9. UNIX for Advanced & Expert Users

Command line FTP Client

I'm looking for a FTP client that is similar to NCFTP in that I can run a full ftp command in one line without needing to access the client first then typing the ftp commands. Very simple request but I can't find any other tool like that, I have downloaded Kermit thinking I can use it to tranfer... (3 Replies)
Discussion started by: tamkag
3 Replies

10. UNIX for Dummies Questions & Answers

FTP Client

Is there any ftp CLIENT(either freeware or sharware) can support passive mode else ncftp? Thanks! (2 Replies)
Discussion started by: coolmans
2 Replies
Login or Register to Ask a Question