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@usa.net>
Information Systems Contractor (http://members.telocity.com/~dpuryear)
PGP Key for dpuryear@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
On Thu, Jan 31, 2002 at 12:47:41AM -0600, Dustin Puryear wrote:> 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/testdir2Problem 1: you need to specify both source and destination directories. Problem 2: by default all files are included, so adding a --include-from doesn't do anything unless you also finish it with an --exclude '*'. Problem 3: doing an --exclude '*' will also exclude parent directories so you will need to explicitly include all parent directories. I'm planning on writing an option to rsync called --files-from that will permit specifying an explicit list of files and avoid includes and excludes but I haven't been able to get to it yet. Please read the rsync.1 man page section "EXCLUDE PATTERNS" carefully. - Dave Dykstra
Possibly Parallel Threads
- DO NOT REPLY [Bug 7565] New: --check-point=<TIME> +options.c.patch +generator.c.patch
- "Input/output error" on mkdir for PPC64 based client
- [PATCH v2] xfstests: btrfs/316: cross-subvolume sparse copy
- "Input/output error" on mkdir for PPC64 based client
- Samba4 issue: roaming profile mismatch betweens W2k/XP machines due to enabled o