By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,626 Members | 2,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,626 IT Pros & Developers. It's quick & easy.

Reg : File transfer using SCP script

P: n/a
sat
Hi,

I'm working as a DB2 UDB DBA.
I have some questions regarding SCP command...
Actually every week redirect restore takes place from one of my
production servers to test servers..
So, but before i can restore it on the test server i need to transfer
the backup file from the production server... So i want use the SCP
command to do that... since it takes place on every wednesday early
morning i would like run the scp command using script...
If there is any chance for me, that i can do so please let me know
ASAP...
Its bit urgent for me....
*** The servers are in AIX environment***

Jun 5 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On 5 Jun., 11:16, sat <vijji.em...@gmail.comwrote:
Hi,

I'm working as a DB2 UDB DBA.
I have some questions regarding SCP command...
Actually every week redirect restore takes place from one of my
production servers to test servers..
So, but before i can restore it on the test server i need to transfer
the backup file from the production server... So i want use the SCP
command to do that... since it takes place on every wednesday early
morning i would like run the scp command using script...
If there is any chance for me, that i can do so please let me know
ASAP...
Its bit urgent for me....
*** The servers are in AIX environment***
maybe an AIX-group would be better then ?

of course you could use an autometed SCP to do so.

use crontab to start script to transfer and restore on test-server (or
if only want to start an scp-transfer, e.g. an one-liner, you can
directly in your crontab)

for scp you have to:
- generate ssh-key on prod-server for the user which will do the
transfer, use empty passphrase (otherwise you will be prompted for
passphrase every time you use scp)
- add public-part of key to "authorized_hosts" on test-server
- do an ssh-login prod--->test (to answer fingerprint question)
this is only once neccessary

be warned: the empty-passphrase thing is an security issue! because it
allows ssh-login without pwd (from prod --test with this user), to
restrict it only to scp or only a specific scp-command it's a bit more
complicated (but feasible)

a sample-script could be:
-------------------------------------
ssh testsrv "rm ${BACKUPPATH}/*.001*" # remove last backupfile
from test
scp ${BACKUPPATH}/*.001* testsrv:${BACKUPPATH}/ # copy new
backupfile --test
ssh testsrv "/usr/local/dba/restore_DB.sh" # start restore script
on test

Jun 5 '07 #2

P: n/a
sat
On Jun 5, 2:16 pm, sat <vijji.em...@gmail.comwrote:
Hi,

I'm working as a DB2 UDB DBA.
I have some questions regarding SCP command...
Actually every week redirect restore takes place from one of my
production servers to test servers..
So, but before i can restore it on the test server i need to transfer
the backup file from the production server... So i want use the SCP
command to do that... since it takes place on every wednesday early
morning i would like run the scp command using script...
If there is any chance for me, that i can do so please let me know
ASAP...
Its bit urgent for me....
*** The servers are in AIX environment***
Sorry to bother you again.... Can you please let me know what u mean
by this in detail:
for scp you have to:
- generate ssh-key on prod-server for the user which will do the
transfer, use empty passphrase (otherwise you will be prompted for
passphrase every time you use scp)
- add public-part of key to "authorized_hosts" on test-server
- do an ssh-login prod--->test (to answer fingerprint question)
this is only once neccessary

I have basic idea of scripting and not in depth...Please help me
out...

Jun 5 '07 #3

P: n/a
There is a good description how to use and setop scp and other commands:

http://www.ibm.com/developerworks/ai...kingunix3.html

Best regards,
Joachim Müller

"sat" <vi*********@gmail.comschrieb im Newsbeitrag
news:11**********************@i38g2000prf.googlegr oups.com...
Hi,

I'm working as a DB2 UDB DBA.
I have some questions regarding SCP command...
Actually every week redirect restore takes place from one of my
production servers to test servers..
So, but before i can restore it on the test server i need to transfer
the backup file from the production server... So i want use the SCP
command to do that... since it takes place on every wednesday early
morning i would like run the scp command using script...
If there is any chance for me, that i can do so please let me know
ASAP...
Its bit urgent for me....
*** The servers are in AIX environment***
Jun 5 '07 #4

P: n/a
On 5 Jun., 14:44, sat <vijji.em...@gmail.comwrote:
On Jun 5, 2:16 pm, sat <vijji.em...@gmail.comwrote:
Hi,
I'm working as a DB2 UDB DBA.
I have some questions regarding SCP command...
Actually every week redirect restore takes place from one of my
production servers to test servers..
So, but before i can restore it on the test server i need to transfer
the backup file from the production server... So i want use the SCP
command to do that... since it takes place on every wednesday early
morning i would like run the scp command using script...
If there is any chance for me, that i can do so please let me know
ASAP...
Its bit urgent for me....
*** The servers are in AIX environment***

Sorry to bother you again.... Can you please let me know what u mean
by this in detail:
for scp you have to:
- generate ssh-key on prod-server for the user which will do the
transfer, use empty passphrase (otherwise you will be prompted for
passphrase every time you use scp)
- add public-part of key to "authorized_hosts" on test-server
- do an ssh-login prod--->test (to answer fingerprint question)
this is only once neccessary

I have basic idea of scripting and not in depth...Please help me
out...
newsgroups are for specific problems or tips not for general
introduction to common thems like "ssh/scp for dummies".
please get yourself one of the many good introductions into ssh
(printed or online).

Jun 5 '07 #5

P: n/a
sat wrote:
Hi,

I'm working as a DB2 UDB DBA.
I have some questions regarding SCP command...
Actually every week redirect restore takes place from one of my
production servers to test servers..
So, but before i can restore it on the test server i need to transfer
the backup file from the production server... So i want use the SCP
command to do that... since it takes place on every wednesday early
morning i would like run the scp command using script...
If there is any chance for me, that i can do so please let me know
ASAP...
Its bit urgent for me....
*** The servers are in AIX environment***
I would recommend rsync (you can have it use ssh) over scp
/Lennart
Jun 5 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.