<div class="gmail_quote">On Mon, May 24, 2010 at 8:50 AM, Leon Castellanos <span dir="ltr"><<a href="mailto:lcastellanos@mentora.com">lcastellanos@mentora.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Does anyone know if –delete can work with –files-from?</p></div></div></blockquote><div> </div><div>That depends on what you're expecting to be deleted. Rsync only deletes files from within directories that it sends, so any directories mentioned in the --files-from list will have files deleted from inside them. Items that used to be in the files-from list but are not anymore are outside the transfer, and will not be affected. Since you are sending only files, nothing will ever be deleted.</div>
<div><br></div><div>For what you're doing, you should use a filter list instead. With that, you construct a source directory that includes and excludes various files, and the destination will treat that edited directory as the content that it should duplicate. You should either use show/hide filter rules (so hidden items are not protected from deletion on the receiver) or use --delete-excluded.</div>
<div><br></div><div>Here's how to use show and hide:</div><div><br></div><div>Start by creating anchored show (S) rules for filter (I just added "S /" here):</div><div><br></div><div>find $DIR/lvl1 -maxdepth 1 -type f –mmin +30| /usr/bin/awk -F/ '{print "S /"$8"/"$9}' >/tmp/$FILES;</div>
<div><br></div><div>Those rules should look like "S /lvl1/foo" because (I believe) you want lvl1 as part of the transfer.</div><div><br></div><div>Then, do a copy something like this:</div><div><br></div><div><div>
rsync -ptrgoz --stats --delete --fiter=". /tmp/$FILES" --filter="H /lvl1/*" $DIR/lvl1 $RDEST/</div></div><div><br></div></div><div>Note the hide (H) rule hides any filename in the lvl1 dir not mentioned in the show list. The lvl1 dir is being sent, so RDEST gets lvl1/foo files put in it. Any old files in lvl1 get removed.</div>
<div><br></div>..wayne..<br>