Solved

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

Posted on 2008-10-13
5
302 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
5 Comments
 
LVL 2

Accepted Solution

by:
tmaleshafske earned 175 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 75 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now