Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I would like to use SCP and transfer files from one server to the other.
I have a target filename paths embedded inside a file called FileB.txt. The contents are similar as shown below:/u1040/oradata/orcl/cwmlite01.dbf
/u1040/oradata/orcl/drsys01.dbf
.....I will get source filename path from tmp file 'FileA.txt' using 'select name from dba_data_files table.
FileA.txt contains
/u2020/oradata/orcl2/cwmlite01.dbf
/u2020/oradata/orcl2/drsys01.dbf
.......I would like to read both files line by line and pass it as variables in the script for copying to remote machine.
The code would be :
scp $FileA $server/$FileBfor each file.
Any help??
Thanks and Regards
Sureshsureshht

Hi,
As of now, I am doing SCP manually hard coded script as shown below.
echo "############ Controlfile copy Start ###########" >>$tmpfile
file89=/export/home/oracle/sur/strtagent.trc
file89a=$server/export/home/oracle/sur/strtagent.trcscp $file89 $file89a
if [ $? != 0 ]; then
echo "$file89 $nosuccess" >>$tmpfile
echo " " >>$tmpfile
mailit=true
else
echo "$file89 $success" >>$tmpfile
echo " " >>$tmpfile
mailit=true
fiecho "########### Controlfile copy Complete ###########" >>$tmpfile
echo "Completion time:" >>$tmpfile
date >>$tmpfileif [ "$mailit" = "true" ]; then
# cat $tmpfile | mailx -s " MV" $maillist
uuencode ${tmpfile} ${tmpfile} | mailx -s " File Copy" $maillist
fisureshht

Is the path always
/u1040/oradata/orcl/
and
/u2020/oradata/orcl2/
with the file name staying the same across both hosts?
You extract some of this information from a table. Can you select all of it from a table, possibly with string functions to build both the source and target values?

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |