Score:0

How to only exclude directories in specific places from rsync, and not all directories with a particular name?

co flag

rsync lets you exclude directories like .cache and lost+found when making backups of your home partition. That's great, except it does it for all directories with those names. How can I only exclude /home/lost+found and /home//.cache, and not any others? I doubt I have any other directories named .cache, but still, it's definitely a bad solution otherwise.

PonJar avatar
in flag
Just specify the directories you want to exclude with their full path. eg `/home/user/.cache` If that gets a bit unwieldy use the option to exclude a list that you create in a file
PrakashS avatar
mx flag
It is not that rsync exclude option would exclude all the directories specified, by name, but only the directories in relative path of the backed up directory.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.