473,795 Members | 2,826 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reg : File transfer using SCP script

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
5 6330
On 5 Jun., 11:16, sat <vijji.em...@gm ail.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_hos ts" 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:${BACKU PPATH}/ # copy new
backupfile --test
ssh testsrv "/usr/local/dba/restore_DB.sh" # start restore script
on test

Jun 5 '07 #2
sat
On Jun 5, 2:16 pm, sat <vijji.em...@gm ail.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_hos ts" 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
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*********@gm ail.comschrieb im Newsbeitrag
news:11******** **************@ i38g2000prf.goo glegroups.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
On 5 Jun., 14:44, sat <vijji.em...@gm ail.comwrote:
On Jun 5, 2:16 pm, sat <vijji.em...@gm ail.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_hos ts" 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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4736
by: Alexander Gilman Carver | last post by:
I have written a pair of scripts that are supposed to work together to display an index of files and then, upon the user choosing the files (with checkboxes on an HTML form submitted to itself), tar/gzip the file and send it to them. To this end the first script performs an exec() call and generates the archive (it's a random number but we'll call it foo.bar.tar.gz) and then writes a META tag into the page after it submits the HTML form...
5
3629
by: | last post by:
I am having a major problem with file transfers - they are ending early when the bandwidth tops-out. Smaller files transfer just fine, but large files (12Mb+) can 'abort' the transfer after maybe 35%-60% complete. I'm sending large MP3 files from my website www.TheDoctorDementoShow.com but the users are pretty upset because the files are incomplete. I assume tis has something to do with headers or starting/stopping as the bandwidth...
7
12860
by: Limey Drink | last post by:
Hi all, Firstly :-) , is there any where I can search through archived newsgroup posts so I am not cluttering up the newsgroup with repeated queries ? And secondly :-), I know this has probably been discussed before but. I am wanting to do some scripting to automate a few administration tasks, one of the first tasks is automating FTP file transfers.
15
4780
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is not validate based on some given rules. I also have a custom error handling page to show the...
10
2621
by: John Salerno | last post by:
I always read about how you need to set certain file permissions (for cgi files, for example), but it's never been clear to me *how* you do this. I know you can run the line chmod 755 scriptname.py but *where* do you run this? Is this done on your personal system, or on the server? What if you are using Windows? If it's done on the server, how do you do it?
1
8122
by: Alex | last post by:
Hello, I'm trying to write a little php script to transfert some files from a server to clients (web/http). It's working fin with small files. But transfering big files (try on 1Gb) failed! The transfert is stoped randomly (sometimes at 25%, sometimes at 75%,...). And I don't understand why?! :/
7
4137
by: shadowman | last post by:
Hello all: I have a web app that creates an image of a graph (as a png), based on user input of a combination of drop-down box items. I'm trying to add a function that allows the user to save the graph image to his hard drive, just like right-clicking on the image and selecting 'save image as...' There's a link next to the graph that should open the save image dialog. The link calls the following php script:
0
1705
by: vasikaran | last post by:
Hi , i hava one ftp script in batch file programming , ftp script is working fine.. but my is i dont know how much files and what are files avaiulable in remote folder ,,,, if any errors or failures occurring in ftp process how to trace failure files... everything in batch file script only... this is my ftp script ... @ echo off
1
47492
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10438
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7540
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.