Solved

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

Posted on 2008-10-13
5
307 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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.:
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…

777 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