On Sun, Jan 19, 2025 at 12:43:51 -0300, Eduardo M KALINOWSKI wrote: > Em 19/01/2025 08:57, David escreveu: > > On Sun, 19 Jan 2025 at 02:51, Default User <hunguponcont...@gmail.com> > > wrote: > > > time sudo rsync -aHSxvvv --human-readable --delete --numeric-ids -- > > > info=progress2,stats2,name2 -- > > > exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media > > > /*","/lost+found"} /media/user/DRIVE1/ /media/user/DRIVE2/ ; date > > > > In fact the manpage says: "--exclude options take one rule/pattern each", > > as I have shown above, which is not what you have. > > That's a shell feature, it will expand to multiple --exclude options.
It's called brace expansion, if you're looking for it in the bash manual. In this case, it could be written more concisely: --exclude=/{dev,proc,sys,tmp,run,mnt,media}/\* --exclude=/lost+found The only character that needs to be quoted is the *, so there's no need to include all those extra double quotes. The starting and ending slash, and the ending *, are common to all the patterns except for /lost+found, so those can be moved outside of the braces. Then, since > And for those specific exclusions (except /lost+found), --one-file-system is > probably even better, unless there is a second filesystem mounted somewhere > inside /media/user/DRIVE1 (which seems unlikely). They might have separate /var and /usr or something. Who knows.