Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need to archive a directory structure while completly ignoring ".svn" directories

Posted on 2008-10-13
5
Medium Priority
?
329 Views
Last Modified: 2013-11-15
Hi,

I want to archive a directory structure (FYI: checked out from Subversion) where a hidden directory ".svn" appears at every level of the directory structure BUT I DO NOT want this directory (or its contents) to appear in the archive file..

To state it another way, for clarity, I want to archive all files and directories in a specified directory and ignore directories (and contained files) named ".svn"

FYI: I am using ubuntu linux 8.04

Many thanks for your help,

John
0
Comment
Question by:johnwarde
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 2

Accepted Solution

by:
tmaleshafske earned 700 total points
ID: 22701465

rsync is an excellent tool and has well document man pages.  I know from experience that it has the option to ignore specific directories.  There are also plenty of tutorial online on how to use it.  In addition there is a graphical front-end by I recommend to use the command line.
0
 
LVL 15

Assisted Solution

by:veedar
veedar earned 300 total points
ID: 22702476
tar version 1.20 has an option  --exclude-vcs
which will exclude .svn's


For more info do a    man tar
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 22703476
see the options

--exclude FILE                   exclude file FILE
-X, --exclude-from FILE     exclude files listed in FILE

Please see

http://linux.about.com/od/commands/l/blcmdl1_tar.htm
0
 
LVL 2

Author Comment

by:johnwarde
ID: 22703566
Hi tmaleshafske,

I looked at rsync and it has lots of options, after much searching though the documentation, I found the options to solve my problem, for the benefit of others this is an example of what I used:

rsync -avzC --exclude="dbdata/" /home/me/src/  /home/me/backup/20081013

The above command copies (and compresses) the contents of /home/me/src/ to the /home/me/backup/20081013 direcory, the "-C" option ignores the ".svn" directories (including other common build generated files/directories); I used the "--exclude=dbdata/" option to exclude non-source datafiles.



Hi veedar,

Unfortunately the synaptic package manager GUI on my ubuntu 8.04 installation will not allow me to upgrade my "tar 1.19-3" package to 1.20, presumably becuase it has not been released or supported yet by unbuntu.

Thanks both of you for your help!

John

0
 
LVL 2

Expert Comment

by:tmaleshafske
ID: 22703739
Also it you are working on a project and need to do hourly updates you can accomplish that with a cron job
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question