On Tue, 2008-03-11 at 23:10 -0500, forgottenwizard wrote:
> I'm messing around with doing backups via rsync to an external hard
> drive, and I'm wanting to be able to strip out unneeded files from the
> backup
define "unneeded". This is highly system dependant, as everyone puts
important files all over the place.
> (these will be archived by, probably, dar or tar later on), and
> was wondering if someone knew what I could strip out.
from the subject line I assume you want to be able to restore a bootable
system? If so, you may need to back up more than just filesystems.
What about the partition table and the master boot record? You can back
up the mbr to a file by using dd:
$ sudo dd if=/dev/hda of=mbr.img bs=512 count=1
(replace hda with your boot drive).
In terms of Gentoo, you can strip out /var/tmp /usr/portage /home and
possibly /opt. Probably some /var subdirs too like /var/log /var/www
etc and some /usr subdirs like /usr/games /usr/include /usr/src etc.
I'd say you _need_ /dev /proc and /sys.
If you _really_ want to know for sure, turn on the atimes option in
fstab for all your partions, then reboot and do a bit of stuff (log in,
ssh, etc). Then use `find` to find all files that were accessed.
Something like this:
* edit /etc/fstab, delete noatime (replacing it with "defaults" if
no other options remain)
* $ touch /var/tmp/reference
* $ shutdown -r now
* log in, look around
* find / -anewer /var/tmp/reference
The output from the last command will be everything you _need_ to boot.
Ideally, when backing up /proc /dev and /sys, do so from a cleanly
shut-down system.
HTH,
--
Iain Buchanan <iaindb at netspace dot net dot au>
My brother sent me a postcard the other day with this big sattelite photo of
the entire earth on it. On the back it said: "Wish you were here".
-- Steven Wright
--
[email protected] mailing list