I want to backup my Ubuntu system and I have two partitions to care:
One is /
, another is /home
.
I'll likely want to backup /
. This is not even that big so I can carry it on my SD card, while being responsive enough for making me want to have a image of it (that's why I'm trying to use rsync at this moment).
And about /home
, it has many subdirectories that I do not care about much so I'll not likely include them, but I want to take care about files on there, such like .bash_history
, .bashrc
, .face
, and so on.
So I want to exclude all subdirectories while including files in /home
. How can I achieve that?
--exclude "*/"
wasn't working. "/*/"
, "/**/"
, --include "*" --exclude */
doesn't show me what I want. at least it copied the source folder, without copying anything inside it.
rsync -r -t -p -o -g -v --progress --delete --modify-window=1 -l -H -b -s --exclude home/dinir/ --exclude media/ --exclude proc/kcore / /home/dinir/Temporal Site for Storing Backups
– Dinir Jun 04 '15 at 08:40-f" */" -f"+ *"
in my code be safe? Maybe it would be like-f"- home/dinir/*/" -f"+ home/dinir/*"
? – Dinir Jun 04 '15 at 08:41-f"- home/dinir/*/" -f"+ home/dinir/*"
– Maythux Jun 04 '15 at 08:50