Sponsored Content
Top Forums UNIX for Dummies Questions & Answers copy files to different servers Post 302368606 by sexyTrojan on Thursday 5th of November 2009 07:11:52 AM
Old 11-05-2009
Data copy files to different servers

Please Help!
I have data containing wav, txt and different type of files on server A and i'm trying to write a script to copy these files in server B, C and D but each type of files goes to different directories on those server for eg. txt files goes to Text directory and wav goes to music directory and so on. But before copying over I wish to back up the files if the file in server A already existed in server B,C and D
The servers are mirror to each other. I tried to get started but then then i got stuck when trying to copy multiple files resulted from ls

Code:
#!/bin/sh

#### I am now in server A ######
echo "what directory where your store your files?"
read dir
varA=`ls $dir`
array=(serverB serverC serverD)
for index in array
do
ssh array[index]
echo "$PWD"
for file in $varA; do
case $file in
*.wav)
cd /root/music/Mymusic/ | cp $varA $varA$.bak

##stuck##

 

10 More Discussions You Might Find Interesting

1. Solaris

what files need to copy when clone servers?

If I need to clone application server-A to server-B (same IP). What files that I must copy to server-B? server-A : Solaris8 and run application(bea-weblogic) server-B : Only Solaris8 install I think it should be. - O/S patches - /etc/system -- for kernel tunning. - /etc/shadow -... (3 Replies)
Discussion started by: arm_naja
3 Replies

2. Shell Programming and Scripting

Copy a file on remote servers

Hey Unix Gurus, I'm having trouble in copying a file on 5 different servers, first how can you do it locally (i.e without the need to ssh to the server you want to copy the file) and if you need to ssh how do u run a command within that server. Please see my code below(it doesn't work somehow).... (10 Replies)
Discussion started by: sexyTrojan
10 Replies

3. Solaris

How to safely copy full filesystems with large files (10Gb files)

Hello everyone. Need some help copying a filesystem. The situation is this: I have an oracle DB mounted on /u01 and need to copy it to /u02. /u01 is 500 Gb and /u02 is 300 Gb. The size used on /u01 is 187 Gb. This is running on solaris 9 and both filesystems are UFS. I have tried to do it using:... (14 Replies)
Discussion started by: dragonov7
14 Replies

4. Shell Programming and Scripting

shell script to take input from a text file and perform check on each servers and copy files

HI all, I want to script where all the server names will be in a text file like server1 server2 server3 . and the script should take servernames from a text file and perform copy of files if the files are not present on those servers.after which it should take next servername till the end of... (0 Replies)
Discussion started by: joseph.dmello
0 Replies

5. AIX

Copying files between two servers

Hi, I have a 60 GB file (tar file) in server1 and I have mounted server2 (using nfs mount) on server1 and then I am copying the file from server1 to server2. Even after 6 hours, the file copying is still not completed. It has just copied 20 GB of file so far. Please help me identify this... (3 Replies)
Discussion started by: qAnand
3 Replies

6. Shell Programming and Scripting

Sftp files between servers

I am writing a shell script to copy sybase related .dump files from one to another aix server and visa versa. Please help me do the following The script does the following: - check directory exists - copy dump files - copy is done for multiple database - checks databases, if one... (11 Replies)
Discussion started by: nmm_dba
11 Replies

7. HP-UX

Decryption of files on HP-UX servers?

I am pulling a file from sfdc to HP-UX servers. But in HP-UX servers, the file data shows encrypted. Can anyone tell me how to decrypt them? The file data is like- ... (1 Reply)
Discussion started by: saga20
1 Replies

8. Shell Programming and Scripting

Script to overwrite & before that keep copy a file on many servers

I have ssh password less auth enable & script does the job well as well #/bin/bash for i in `cat ip` do scp /etc/resolv.conf root@$ip done But I need to take backup of the file i will overwrite .. is there any simple way ? Kindly respond (5 Replies)
Discussion started by: heman96
5 Replies

9. UNIX for Dummies Questions & Answers

Copy files from one drive to another, keeping most recently modified files

Hi all, I am a bit of a beginner with shell scripting.. What I want to do is merge two drives, for example moving all data from X to Y. If a file in X doesn't exist in Y, it will be moved there. If a file in X also exists in Y, the most recently modified file will be moved to (or kept) in... (5 Replies)
Discussion started by: apocolapse
5 Replies

10. Shell Programming and Scripting

Need help with script to copy code to multiple servers

Hi, I am new to scripting and i am trying to use below script to copy code to multiple servers and multiple locations on each server. the script is not working or doesnt give any error. Any help is appreciated. basically i want a script to get the code from a location (dir below) and read the... (2 Replies)
Discussion started by: Ron0612
2 Replies
pilot-wav(1)							    PILOT-LINK							      pilot-wav(1)

NAME
pilot-wav - Decodes Palm Voice Memo files to wav files you can read on your desktop SECTION
pilot-link: Userland conduits SYNOPSIS
pilot-wav [-p|--port <port>] [--version] [-?|--help] [-q|--quiet] [--usage] [-f|--fetch [file|all]] [-c|--convert file] OPTIONS
pilot-wav options -f, --fetch [file|all] Fetch all wav files or specified wav file from the Palm. -c, --convert file.wav.pdb Convert file.wav.pdb file to wav Conduit Options -p, --port port Use device file port to communicate with the Palm handheld. If this is not specified, pilot-wav will look for the $PILOTPORT environment variable. If neither are found or supplied, pilot-wav will print the usage information. -q, --quiet Suppress 'Hit HotSync button' message -v, --version Display version of pilot-wav. Help Options -h, --help Display the help synopsis for pilot-wav. --usage Display a brief usage message and exit without connecting. EXAMPLES
# Fetch all of the voice memo files from your Palm and save them to .wav files on your desktop machine pilot-wav -p /dev/pilot -f MyVoiceMemo.wav.pdb # Convert all voice memos found in MyVoiceMemo to .wav files on your desktop machine pilot-wav -c MyVoiceMemo.wav.pdb AUTHOR
This manual page was written by Neil Williams <linux@codehelp.co.uk> REPORTING BUGS
We have an online bug tracker. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed. Reporting bugs via email, while easy, is not very useful in terms of accountability. Please point your browser to http://bugs.pilot-link.org: http://bugs.pilot-link.org and report your bugs and issues there. COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. SEE ALSO
pilot-link(7) 0.12.5 Copyright 1996-2007 FSF pilot-wav(1)
All times are GMT -4. The time now is 03:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy