Article 4T0SC Can't get rsync exclude to work correctly

Can't get rsync exclude to work correctly

by
MALDATA
from LinuxQuestions.org on (#4T0SC)
Hi all,

This has been bothering me for a while, and I can't figure out where the problem is. I use ssh & rsync to do remote backups. On the machine I'm backing up, there is a "VirtualBox VMs" directory that is huge and doesn't need to be backed up. I also don't need to back up all the hidden directories in home. So, I run

Code:rsync -avSXe "ssh -p <port>" --delete --exclude=".*/" --exclude="VirtualBox\ VMs/" host:/home/user/ /home/user/backupThis correctly excludes all hidden directories, but it still rsyncs the VM directory. I've tried all different kinds of syntax, for example,

Code:rsync -avSXe "ssh -p <port>" --delete --exclude=".*/" --exclude={"VirtualBox\ VMs/"} host:/home/user/ /home/user/backupCode:rsync -avSXe "ssh -p <port>" --delete --exclude={".*/","VirtualBox\ VMs/"} host:/home/user/ /home/user/backupCode:rsync -avSXe "ssh -p <port>" --delete --exclude=".*/" --exclude={"VirtualBox\ VMs/"} host:/home/user/ /home/user/backupCode:rsync -avSXe "ssh -p <port>" --delete --exclude=".*/" --exclude="VirtualBox*/" host:/home/user/ /home/user/backupAnd so on. None of them have worked. It rsyncs the VM directory every time. What am I missing? Thanks!latest?d=yIl2AUoC8zA latest?i=yt78WYhvIQw:2Jf7nqPBL_g:F7zBnMy latest?i=yt78WYhvIQw:2Jf7nqPBL_g:V_sGLiP latest?d=qj6IDK7rITs latest?i=yt78WYhvIQw:2Jf7nqPBL_g:gIN9vFwyt78WYhvIQw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments