Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to do a simple system backup (with cpio or tar), and I was looking for what I need to back up and found this question. The answer was basically, "it depends on what you're running on your machine".

If there is a disk failure, I want to easily get my server running again without having to reinstall a lot of things. I'm using a web server and a fair amount of 3rd party programs. I'm thinking I'll back up everything except the absolutely unnecessary.

So are there any directories that I shouldn't backup because it would be a waste of time and disk space?

share|improve this question
1  
actually you should backup every filesystem but it is not necessary to dump the filesystems which don't have to be retrieved on full-restoration. For example, if /tmp is an independent filesystem, it can be excluded immediately. Similarly, cache data of proxy daemon can also be omitted. As well, the spool, overview database and history of Netnews system may be excluded if you give up on them. –  harish.venkat Dec 21 '11 at 19:11
    
I see, so does that mean I tar everything in at / –  User1231424214112 Dec 21 '11 at 19:21
    
you can do tar at / or you can use dump see surf.ml.seikei.ac.jp/~nakano/dump-restore/… –  harish.venkat Dec 21 '11 at 19:27
add comment

2 Answers 2

If in doubt, back up everything that's on disk.

The most obvious things you can skip backing up are swap and /tmp (which may be in virtual memory already).

If you want to save backup space, at the expense of a slower recovery, you can omit /usr, except /usr/local. To recover, do a minimal system installation, install packages you had installed (this is distribution-dependent), then recover from the backup.

There are bits and pieces in /var that you don't need to back up. In particular, anything in /var/cache is meant to be regenerated on demand. There's one exception: /var/cache/debconf/config.dat and /var/cache/debconf/passwords.dat on dpkg-based systems contains Debian package configuration data entered by the administrator (it's out of place under /var/cache).

share|improve this answer
add comment

In-memory filesystems and temporary filesystems can usually be skipped. /proc, /sys, /dev etc.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.