Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi ,
we have a standby database and everyday in the night at 1 a.m we have to ftp the archive log files from the production server to the standby server and we do the same at 6 a.m in the morning also. now i am trying a write a shell script and run it at 6 a.mwhich will ftp only those files which are created between 1.am to 6 a.m. i really don't know how to catch the files based on their timestamp.any help will be highly appreciated. following is the script i wrote to ftp the files from prod to standby.
cd /ora02/oracle/archftp -i -n orctest <<EOF
user oratest pword
bin
cd /ora03/oracle/arch
ls
mget *.arc
bye
EOF
regards,
vidyanath

There are a few programs out that you can use to do this.
I found that a script worked best for me. This may help:#!/bin/ksh
# Change perms on this script to 700
# to avoid compromising the password
# The line below starts at echo and ends at macdef
echo "machine orctest login oratest password pword macdef
init
lcd /ora02/oracle/arch/logtmp
cd /ora03/oracle/arch
bin
mget *.arc
quit
" > $HOME/.netrc
chmod 600 $HOME/.netrc
ftp -i orctest
sleep 5# The line below starts at echo and ends at macdef
echo "machine orctest login oratest password pword macdef
init
cd /ora03/oracle/arch" > $HOME/.netrc
cd /ora02/oracle/arch/logtmp
for i in *.arc
do
j=$i.`date +%m%d%y`
echo "rename $i $j" >> $HOME/.netrc
done
echo "quit
" >> $HOME/.netrc
chmod 600 $HOME/.netrc
ftp orctest
sleep 5
mv /ora02/oracle/arch/logtmp/* ../

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |