Files getting excluded.. don't understand why?
Dustin Puryear
dpuryear at usa.net
Thu Jan 31 17:47:41 EST 2002
I am trying to use rsync along with find to quickly copy changes to mirrors
for some web sites. The basic idea is:
1 look for files newer than X >> export-file
2 rsync --include-from=export-file remote-server:/remote-path
Simple enough. Unfortunately, I can't get this to work. Step 1 works well
enough. However, when I use rsync it appears that rsync is excluding the
files I added via export-file. I'm not sure what I'm doing wrong. Here is
the command I am using:
rsync -vvv -e ssh -r --include-from=$TOCOPY localhost:/home/dpuryear/testdir2
Notice I'm debugging rsync, so I have it running in verbose mode on some
test directories. The full script is below:
#!/bin/sh
PATH=/bin:/usr/bin:/usr/local/bin
LOCKFILE=/home/dpuryear/sync_www.lock
LASTRUN=/home/dpuryear/sync_www.lastrun
TOCOPY=/home/dpuryear/tocopy
DIRLIST="/home/dpuryear/testdir"
WWWLIST=localhost
if [ -f $LOCKFILE ]; then
exit
else
touch $LOCKFILE
fi
# create copy list
rm -f $TOCOPY
for dir in $DIRLIST; do
cd $dir
# find files newer than $LASTRUN
if [ -f $LASTRUN ]; then
find ./ \! -regex '\./logs.*' -cnewer $LASTRUN -print >
$TOCOPY
else
find ./ \! -regex '\./logs.*' -print > $TOCOPY
fi
# update $LASTRUN
touch $LASTRUN
# grab any files added VERY recently
find ./ \! -regex '\./logs.*' -cnewer $LASTRUN -print >> $TOCOPY
rsync -vvv -e ssh -r --include-from=$TOCOPY
localhost:/home/dpuryear/testdir2
done
rm -f $LOCKFILE
rm -f $LASTRUN
Regards, Dustin
---
Dustin Puryear <dpuryear at usa.net>
Information Systems Contractor (http://members.telocity.com/~dpuryear)
PGP Key for dpuryear at usa.net (http://www.us.pgp.net)
In the beginning the Universe was created.
This has been widely regarded as a bad move. - Douglas Adams
More information about the rsync
mailing list