You are not logged in.

#1 2008-12-21 19:25:14

devil_kc
Member
Registered: 2008-09-14
Posts: 93

backup question

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

#2 2008-12-21 20:27:02

darkarchon
Member
From: Israel
Registered: 2007-02-28
Posts: 44

Re: backup question

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

#3 2008-12-21 20:37:21

devil_kc
Member
Registered: 2008-09-14
Posts: 93

Re: backup question

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

#4 2008-12-21 20:44:59

darkarchon
Member
From: Israel
Registered: 2007-02-28
Posts: 44

Re: backup question

I found this in the first result in Google (I had to know how! smile

find -regex './\..*' | tar cvf ./test.tar -T -

Offline

#5 2008-12-22 11:02:05

devil_kc
Member
Registered: 2008-09-14
Posts: 93

Re: backup question

kudos @darkarchon! thats it. thanx

Offline

Board footer

Powered by FluxBB