I have two servers: 1.EOS(Linux RHEL 4) and 2.domain1(Solaris 10)

In EOS, ftp rcp scp is blocked.

In EOS, I have some backup files of oracle database saved in /user/orac/monthly/ path. My backup end at 9pm. Three backup file are generated per day. I want to copy these three files to my domain1 server. Manually I copied from EOS to domain1 like the following command:

rcp -p EOS:/user/orac/monthly/daily_backup_ORAC_edshhyjjak_3445_1 .

But it is easier for one specific file. But how to find the current dated files and copy them (three files) to my local server?

Files are like this,

-rw-r--r-- 1 oracle dba 9835748338 Mar 18 20:40  daily_backup_ORAC_e6rvgtgt_3445_1
-rw-r--r-- 1 oracle dba   54546677 Mar 18 20:40  daily_backup_ORAC_e7rvfght_3446_1
-rw-r--r-- 1 oracle dba 5454555666 Mar 18 20:40  daily_backup_ORAC_e8rvfdhj_3447_1

These three files of today's date to be copied to domain1:/database/backup_eos/ path

Alos tried

find /user/orac/monthly/ -name daily_backup_ORAC_*' -mtime -exec rcp -p "{}" domain1:/database/backup_eos/ \;

But it is giving error as rcp is blocked in EOS! I have to run this command in domain1 which will find current date files in EOS of this /user/orac/monthly/ path and copy in domain1 /database/backup_eos/ path.


in EOS at the end of backup run

find /user/orac/monthly/ -name 'daily_backup_ORAC_*' -mtime -1 -print > /var/tmp/todays_backup.txt

in domain1 do

rcp EOS:/var/tmp/todays_backup.txt /var/tmp
for f in $(< /var/tmp/todays_backup.txt)
    rcp -p EOS:$f /database/backup_eos/

this way, find is done locally, and domain2 only has to fetch list and get file.

if $(< ) is not supported use

 while read f
 done < /var/tmp/todays_backup.txt
  • Yes it is working :-)
    – Nainita
    Mar 20 '17 at 11:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.