DragonFly BSD
DragonFly users List (threaded) for 2006-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cpdup backup question


From: Oliver Fromme <check+iu9znf00rsf2xvn9@xxxxxxxxxx>
Date: 06 Feb 2006 17:35:51 GMT

Terry Tree <terry.tree@xxxxxxxxx> wrote:
 > Hello.  I'm trying to use cpdup to backup my desktop to my little home
 > server via NFS.  The question I have is there a way to have a global
 > cpignore file ?  I don't have to place an ignore file in every
 > directory.  I want to exclude all of my mp3 and iso files so my server
 > doesn't fill up.  Does anyone know of a work around for this ?

My workaround for similar things is not to use cpdup, but
find(1) and cpio(1).  In your case, something like this
should work:

# cd $SOURCE
# find -d . | egrep -v '\.(mp3|iso)$' | cpio -dump $TARGET

Another advantage is the fact that mtimes of directories
will be preserved, which cpdup doesn't do.

However, the disadvantage is that cpio will always copy all
files, even if they already exist in the destination.  But
that can be fixed to some extent by using the -newer option
of find:  Before starting the backup, touch a file.  For
the next backup, use that file as a "marker" to backup only
files that are newer or have changed since then:

# touch /var/db/thisbackup
# cd $SOURCE
# find -d . -newer /var/db/lastbackup | grep -vf /etc/backup.excl | cpio -dump $TARGET
# mv -f /var/db/thisbackup /var/db/lastbackup

# cat /etc/backup.excl
\.mp3$
\.iso$
\.iso.gz$
\.iso.bz2$

Best regards
   Oliver

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd

Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]