Operating System - HP-UX
1827294 Members
1644 Online
109960 Solutions
New Discussion

Re: Auto File transfer between HP UX server

 
SOLVED
Go to solution
Sandeep Geet
Occasional Contributor

Auto File transfer between HP UX server

I have HP rp7410 with HP-UX 11i V1 partitioned on 2 logical servers. I need to do auto file transfer between 2 servers with a defined schedule.

How can I do that?
Can some one help?

Best Regards,
Sandeep
5 REPLIES 5
Sanjay Kumar Suri
Honored Contributor

Re: Auto File transfer between HP UX server

You can write a small ftp script for transferring files between two systems which can be scheduled periodically using cron.

Search on this forum for a sample ftp script.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Robert-Jan Goossens
Honored Contributor

Re: Auto File transfer between HP UX server

KapilRaj
Honored Contributor

Re: Auto File transfer between HP UX server

use this command in a script and schedule it using cron

tar cvf - . |remsh "(cd dir;tar xvf -)"

Kaps
Nothing is impossible
V.Tamilvanan
Honored Contributor
Solution

Re: Auto File transfer between HP UX server

Hi,

To do automatic file transfer you can use either ftp or rcp scripts and schedule the script in cron.


Example script:-
---------------------
ftp -i -n -v RemoteServer << EOF
user unix unix
lcd /LocalDir
put $SERVER.perf
put omnirpt.html
bye
EOF
----------------

man rcp
man ftp
twang
Honored Contributor

Re: Auto File transfer between HP UX server

the following script I used in my environment, hope it help.
-----------------------
#!/bin/sh
server=svrA
user=oracle
passwd=
INSTANCE=erp
BASEDIR=/bkup
REMOTEDIR=/dbmgmt/bkup
BKUPFILE=$INSTANCE_`date '+%d%m%y'`.bak
echo "open $server" > /tmp/ftpinput
echo "user $user $passwd" >> /tmp/ftpinput
echo "lcd $BASEDIR" >>/tmp/ftpinput
echo "cd $REMOTEDIR" >>/tmp/ftpinput
echo "bin" >>/tmp/ftpinput
echo "hash" >>/tmp/ftpinput
echo "put $BKUPFILE" >>/tmp/ftpinput
echo "bye" >>/tmp/ftpinput
ftp -n
/tmp/autoftp.log
/bin/rm /tmp/ftpinput
-----------------------