Greetings. I've been using rsync for quite a long time. I have a homedir I like to backup to a NAS. I find myself having to manually specifying paths rather than letting rsync copy the entire home directory. I lack development skills. Would there be a way for rsync to be passed an option to exclude a specific path during a sync operaton? All of my attempts to use exclude have failed, as it does not respect paths, only filetypes. -- Regards, Matt Stevens
Hi Matt, On Sat, Aug 01, 2020 at 10:10:49PM -0400, Matt Stevens via rsync wrote:> I lack development skills. Would there be a way for rsync to be passed an > option to exclude a specific path during a sync operaton? All of my attempts > to use exclude have failed, as it does not respect paths, only filetypes.The existing --exclude and filter file options work for me for this. Maybe show us what you're doing (command line), what you expect to happen and what actually happens? You absolutely can exclude paths. The exclude and filter options are very expressive. I've been doing it for years. Cheers, Andy
So I've gotten excluding paths to work as a standalone command. When I paste this into a script however, it ignores the exclusions. Any advice? rsync -aXvr --times --links --exclude={'*.vdi','*.vmdk','*.ova','*.qcow2','.config/discord/'} /home/path/ user at nas:/NAS/HOME/destination/ Are there supposed to be some kind of brackets around this? Regards, Matt Stevens On 8/2/20 10:19 AM, Andy Smith via rsync wrote:> Hi Matt, > > On Sat, Aug 01, 2020 at 10:10:49PM -0400, Matt Stevens via rsync wrote: >> I lack development skills. Would there be a way for rsync to be passed an >> option to exclude a specific path during a sync operaton? All of my attempts >> to use exclude have failed, as it does not respect paths, only filetypes. > The existing --exclude and filter file options work for me for this. > Maybe show us what you're doing (command line), what you expect to > happen and what actually happens? > > You absolutely can exclude paths. The exclude and filter options are > very expressive. I've been doing it for years. > > Cheers, > Andy >