Computing.Net > Forums > Unix > SCP hepl

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

SCP hepl

Reply to Message Icon

Name: sureshht
Date: March 17, 2009 at 06:16:05 Pacific
OS: AXI 5.3L
CPU/Ram: 10
Product: Ibm / P550
Subcategory: General
Comment:

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/$FileB

for each file.

Any help??

Thanks and Regards
Suresh

sureshht



Sponsored Link
Ads by Google

Response Number 1
Name: sureshht
Date: March 17, 2009 at 11:03:48 Pacific
Reply:

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.trc

scp $file89 $file89a

if [ $? != 0 ]; then
echo "$file89 $nosuccess" >>$tmpfile
echo " " >>$tmpfile
mailit=true
else
echo "$file89 $success" >>$tmpfile
echo " " >>$tmpfile
mailit=true
fi

echo "########### Controlfile copy Complete ###########" >>$tmpfile

echo "Completion time:" >>$tmpfile
date >>$tmpfile

if [ "$mailit" = "true" ]; then
# cat $tmpfile | mailx -s " MV" $maillist
uuencode ${tmpfile} ${tmpfile} | mailx -s " File Copy" $maillist
fi

sureshht


0

Response Number 2
Name: David Perry
Date: June 3, 2009 at 05:52:01 Pacific
Reply:

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?


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: SCP hepl

cron/scp/expect Problem www.computing.net/answers/unix/cronscpexpect-problem/5307.html

Status of a remote file using SCP? www.computing.net/answers/unix/status-of-a-remote-file-using-scp/7390.html

scp fails to copy subdirs and files www.computing.net/answers/unix/scp-fails-to-copy-subdirs-and-files/6937.html