You are not logged in.
I wanted to copy my home directory to an external HD. But there wasn't enough space. A while ago I used luckyBackup to make a backup which uses rsync. I want to do it from the command line now. But I can't figure out how to exclude a directory. The directory I want to exclude keeps being copied.
To figure it out I have been using the Downloads directory in my home directory because it takes to long to copy my home directory. I'm trying to exclude a directory named 'aurget' in the Downloads directory.
According to different websites I used the following commands:
rsync -ah --progress --exclude 'Downloads/aurget' Downloads/ mnt/extHD/backup
rsync -ah --progress --exclude=Downloads/aurget Downloads/ mnt/extHD/backup
rsync -ah --progress --exclude="Downloads/aurget" Downloads/ mnt/extHD/backup
rsync -ah --progress --exclude="Downloads/aurget/*" Downloads/ mnt/extHD/backup
rsync -ah --progress --exclude=/Downloads/aurget Downloads/ mnt/extHD/backup
rsync -ah --progress --exclude=/Downloads/aurget/ Downloads/ mnt/extHD/backup
Every time the Downloads directory is copied with the aurget directory.
Because I couldn't figure it out I reinstalled luckyBackup. I hoped I could learn from the generated command what I was doing wrong. But the result was the same: aurget is not excluded.
rsync -h --progress --stats -r -tgo -p -l -D --update --exclude=/Downloads/aurget/ /home/my_home/Downloads/ /home/my_home/mnt/extHD/backup
So, I hope someone can tell me what I'm doing wrong.
Last edited by lnx (2017-10-10 21:50:27)
Offline
Patterns are relative to the transfer root - your excludes are telling rsync to exclude Downloads/Downloads/aurget and I'm guessing there is no such directory.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Thank you, Trilby, it solved my problem. But apparently this means that luckyBackup makes the same mistake!?
Offline
It's not a mistake, it's expected behaviour.
The mistake is not reading the documentation.
Offline