meaning I want whatever is in $dir3 to be copied to /.
My bad, I mean, not copied, but synced. And allow me to clarify further.
Let's say I have a copy of my system files in /$dir1/$dir2/$dir3/ .
They can be anything; i.e. /etc/fstab ==> /$dir1/$dir2/$dir3/etc/fstab.
But I am syncing more than one system file and from multiple directories.
Therefore I want to sync /$dir1/$dir2/$dir3/* to /, meaning that /$dir1/$dir2/$dir3/etc/fstab gets synced to /etc/fstab, /$dir1/$dir2/$dir3/home/mint/.config gets synced to /home/mint/.config, etc. I.e. /$dir1/$dir2/$dir3/ is the root directory containing the root directories of all the system files I'm syncing.
sudo rsync -rtpogxvlHis --progress --delete --exclude=.Trash-1000 --exclude=lost+found --modify-window=1 --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/media/*,/lost+found} /dir1/dir2/dir3/* /
syncs everything in dir3 to / without placing them in the correct directories. Everything goes into root and makes a huge mess.
sudo rsync -rtpogxvlHisR --progress --delete --exclude=.Trash-1000 --exclude=lost+found --modify-window=1 --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/media/*,/lost+found} /dir1/dir2/dir3/* /
does nothing that I can tell. ( R for relative ) It does not sync anything, or perhaps syncs the source to itself.
Do I have to make each item in the list to be synced a variable which gets placed after /$dir/$dir2/$dir/ and after the / ?
I suppose I need a way to tell rsync the destination for each item, say, using a loop, huh?
I suppose I can't just specify a wildcard and expect it to know where to put them.
I hope I'm making sense.