You are not logged in.
Pages: 1
i got a brand new, shiny hdd and i was thinking.. how about a backup? now that my os is so nicely configured. now the thinking part(the hard part:) )
i argued with my brain. a lot. so finally i figured to tar / becouse i don't need daily/weekly/monthly backup. so i want to tar everything except music/video folders. ergo- no /home. BUT! i want dotfiles. damn. trouble. how to do that? i was thinking a bout something like --include=/home/user/.[a-zA-Z]
i was wrong.
what now? i did the following command:
sudo tar cvzpf /media/storage/bekap/backup-`date '+%d-%b-%Y'`.tgz --same-owner --exclude=/home/* --exclude=/proc/* --exclude=/media/* --exclude=/dev/* --exclude=/mnt/* --exclude=/sys/* --exclude=/tmp/* --exclude=*/lost+found / 2>/media/storage/bekap/error.log
which tared my whole system in 3.6GB i am happy with the result but i want my dotfiles in that! can someone help me with that?
thanx:)
Offline
do you have hidden files in your root folder?
tar works fine for hidden files, unless you want to tar hidden files in the current directory, then there's a problem (since * doesn't give you hidden files).
but you start from / , so there should be no problem.
i just tried, and tar compresses hidden files without any issues.
Offline
okay, i understand but i want only dotfiles. e.g. i wand /home/matija/.config/ but no /home/matija/Music/
or i want /home/matija/.zshrc but no /home/matija/picture.jpg
how to manage to do that? without --exclude=file --exclude=file2...
i just need to --include... what? or how:)
Offline
I found this in the first result in Google (I had to know how!
find -regex './\..*' | tar cvf ./test.tar -T -
Offline
kudos @darkarchon! thats it. thanx
Offline
Pages: 1