<p><br></p><p>This may work. If worked, Pls reply to the list by appending SOLVED to the subject line. Then, Others can beniit. <br></p><p><br></p><p>rsync -avz --delete --exclude=**/stats
--exclude=**/error --exclude=**/files/pictures -e "ssh -i
/root/rsync/mirror-rsync-key" someuser@server1.example.com:/var/www/
/var/www/ </p>
<p>(The <span>--delete</span> option means that files that have been deleted on <span><a href="http://server1.example.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">server1.example.com</a></span>
should also be deleted on <span>
<a href="http://mirror.example.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mirror.example.com</a></span>. The <span>--exclude</span> option means that these files/directories should not be mirrored;
e.g. <span>--exclude=**/error</span>
means "do not mirror /var/www/error". You can use multiple<span> --exclude</span> options. I have listed these options as examples; you can adjust the command to your needs. Have a look at </p><br>another URL to read,
<br><br><a href="http://www.howtoforge.com/mirroring_with_rsync_p2" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.howtoforge.com/mirroring_with_rsync_p2</a><br><br>GOOD LUCK<br><br><div>
<span class="gmail_quote">On 10/3/07, <b class="gmail_sendername">Ski Dawg</b> <<a href="mailto:centos@skidawg.org">centos@skidawg.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello Everyone,<br><br>I am trying to exclude a directory (and all file and sub-directories<br>under that directory) when using rsync.<br><br>I have spent two days on google, but everything that I can find there<br>involves excluding individual files, not an entire directory.
<br><br>I have tried the following commands, but in each case the remove_dir and<br>all of its sub-directories and files area still sent to the remote<br>server.<br><br>1) rsync --delete --compress --archive --rsh=ssh<br>
--exclude="**/remove_dir/**" /local/path/ $user@$host:remote/path<br><br>2) rsync --delete --compress --archive --rsh=ssh<br>--exclude="\*\*/remove_dir/\*\*" /local/path/ $user@$host:remote/path<br><br>
3) rsync --delete --compress --archive --rsh=ssh<br>--exclude="/local/path/**/remove_dir/**" /local/path/<br>$user@$host:remote/path<br><br>4) rsync --delete --compress --archive --rsh=ssh<br>--exclude-from=/path/to/exclude_file /local/path/ $user@
<br>$host:remote/path<br><br>and the /path/to/exclude_file contains:<br># don't include these files/dirs<br>- **/remove_dir/**<br><br>Any thoughts on the proper way to exclude an entire directory and its<br>sub-directories and files when doing an rsync?
<br>--<br>Doug<br><br>Registered Linux User #285548 (<a href="http://counter.li.org">http://counter.li.org</a>)<br>----------------------------------------<br>Random Thought:<br>QOTD:<br> If it's too loud, you're too old.
<br><br>_______________________________________________<br>CentOS mailing list<br><a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br><a href="http://lists.centos.org/mailman/listinfo/centos">http://lists.centos.org/mailman/listinfo/centos
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Thank you<br>Indunil Jayasooriya<br>