From: Mark Woodward Date: 2006-08-02T20:50:05+09:00 Subject: Re: cp * except .svn directories Hi all, On Mon, 31 Jul 2006 23:58:52 +1000, Mark Woodward wrote: > Hi all, > > sorry if this is a repost! Don't know if it's Pan or my ISP but there's > some weirdness going on ATM! > > What I'd like to be able to do is write a script that can copy all > files/directories from a subversion repository except .svn directories. > > This is the best I can come up with from the command line (be gentle ;-)): > > 1. cd to repos dir > 1. tar --exclude=".svn" -cvf foo.tar * > 2. mv foo.tar /path/to/new > 2. cd /path/to/new > 3. tar -xvf foo.tar > > It works but I'm hoping there's a way to do this in a ruby script. If possible > I'd like to be able to input "/path/to/new". > > So if I'm in the repos dir: > > cp_wo_svn.rb > "to where?": /var/www > "done!" > > > thanks, thanks to all for the suggestions. Paul, yep I settled on Julians solution though they all work! repos2local.rb exec "rsync -arvz $HOME/svnwd/Proj1/www/ /var/www/ --exclude=\".svn\"" This copies the 'www' folder from the repos over to /var/www (ignoring the .svn folders) but I'd now like to extend this. ie. repos2local.rb exec "rsync -arvz $HOME/svnwd/Proj1/www/ /var/www/ --exclude=\".svn\"" exec "rsync -arvz $HOME/svnwd/Proj1/includes/ /var/includes/ --exclude=\".svn\"" ie chain together commands. This only does the first exec and I'm wondering is this a 'thread' issue or similar? Any ideas how I handle this? thanks, -- Mark