Solved

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

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Connect to CentOS (in a local VMWare VM) using Putty 7 229
Can't connect to FTP 18 163
SSH setup on ASA 5505 17 127
phpmyadmin memory error 55 96
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

710 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