![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SFTP files to two servers | vharsha | Shell Programming and Scripting | 3 | 05-10-2009 11:23 AM |
| sync files from two different servers. | madan1 | Shell Programming and Scripting | 2 | 03-10-2009 12:50 PM |
| what files need to copy when clone servers? | arm_naja | SUN Solaris | 3 | 02-04-2008 03:52 AM |
| Search Files In Unix Servers | varsai123 | UNIX for Dummies Questions & Answers | 2 | 08-21-2007 03:27 AM |
| moving files across multiple servers | kymberm | UNIX for Advanced & Expert Users | 2 | 10-23-2002 12:04 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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## |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|