1 |
On Tue, 2008-03-11 at 23:10 -0500, forgottenwizard wrote: |
2 |
> I'm messing around with doing backups via rsync to an external hard |
3 |
> drive, and I'm wanting to be able to strip out unneeded files from the |
4 |
> backup |
5 |
|
6 |
define "unneeded". This is highly system dependant, as everyone puts |
7 |
important files all over the place. |
8 |
|
9 |
> (these will be archived by, probably, dar or tar later on), and |
10 |
> was wondering if someone knew what I could strip out. |
11 |
|
12 |
from the subject line I assume you want to be able to restore a bootable |
13 |
system? If so, you may need to back up more than just filesystems. |
14 |
What about the partition table and the master boot record? You can back |
15 |
up the mbr to a file by using dd: |
16 |
$ sudo dd if=/dev/hda of=mbr.img bs=512 count=1 |
17 |
(replace hda with your boot drive). |
18 |
|
19 |
In terms of Gentoo, you can strip out /var/tmp /usr/portage /home and |
20 |
possibly /opt. Probably some /var subdirs too like /var/log /var/www |
21 |
etc and some /usr subdirs like /usr/games /usr/include /usr/src etc. |
22 |
|
23 |
I'd say you _need_ /dev /proc and /sys. |
24 |
|
25 |
If you _really_ want to know for sure, turn on the atimes option in |
26 |
fstab for all your partions, then reboot and do a bit of stuff (log in, |
27 |
ssh, etc). Then use `find` to find all files that were accessed. |
28 |
Something like this: |
29 |
|
30 |
* edit /etc/fstab, delete noatime (replacing it with "defaults" if |
31 |
no other options remain) |
32 |
* $ touch /var/tmp/reference |
33 |
* $ shutdown -r now |
34 |
* log in, look around |
35 |
* find / -anewer /var/tmp/reference |
36 |
|
37 |
The output from the last command will be everything you _need_ to boot. |
38 |
|
39 |
Ideally, when backing up /proc /dev and /sys, do so from a cleanly |
40 |
shut-down system. |
41 |
|
42 |
HTH, |
43 |
-- |
44 |
Iain Buchanan <iaindb at netspace dot net dot au> |
45 |
|
46 |
My brother sent me a postcard the other day with this big sattelite photo of |
47 |
the entire earth on it. On the back it said: "Wish you were here". |
48 |
-- Steven Wright |
49 |
|
50 |
-- |
51 |
gentoo-user@l.g.o mailing list |