LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-26-2006, 07:39 PM   #1
chrisfirestar
Member
 
Registered: Sep 2003
Location: Adelaide, Australia
Distribution: Fedora/RH
Posts: 231

Rep: Reputation: 30
rsync / sh help


Hi everyone,

I havent been on for a while but wanted to get some help for an issue..

Im not the best with sh but I need to do the following in a script.

1. Rsync /www/admin with /repos/admin
2. list all folders under /www/projects
3. for each of those projects
rsync /www/projects/<project> /repos/projects/<project>

its the looping that I have problems with..

Cheers
 
Old 01-26-2006, 07:53 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
1. rsync -av --progress --partial --delete /www/admin/ /repos/admin/

It was hard to tell from your description which directory was the source. In the command above '/www/admin' is the source and '/repos/admin' is the destination. Flip them if you want it the other way.

2. There is no step 2!

3. rsync -av --progress --partial --delete /www/projects/ /repos/projects/

With the -a option, rsync will recurse (copy subdirectories), so there's no need to code it.
 
Old 01-26-2006, 07:59 PM   #3
chrisfirestar
Member
 
Registered: Sep 2003
Location: Adelaide, Australia
Distribution: Fedora/RH
Posts: 231

Original Poster
Rep: Reputation: 30
thanks for your reply.. thing is I want to do each sync individually for the projects because in my repos I have directories for each project.. eg /repos/projects/<project>/source/

so i want the script to list all the projects under /www/projects then do a sync for each of those.. how can I get the list of folders and loop through them for the sync.

You were right btw www is the source
 
Old 01-26-2006, 10:43 PM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
I'm still having a problem understanding the issue. All the projects under /www/projects/, and all the subdirectories in those projects, will be sync'd by the one rsync command. There is no reason to manually traverse the hierarchy.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync sant25 Linux - General 2 09-02-2005 03:34 PM
what is rsync? ilnli Linux - Networking 1 10-13-2004 03:30 AM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM
Rsync eddiefdz Linux - Software 0 02-20-2004 01:56 PM
rsync slack66 Slackware 1 07-29-2003 09:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration