Originally Posted by gacanepa
Here's the listing of my /var/lib directory. Besides mysql and www, which ones would you backup?
drwxr-xr-x 2 root root 4.0K May 17 2010 alien
drwxr-xr-x 5 root root 4.0K Oct 30 19:49 apt
drwxr-xr-x 2 root root 4.0K Oct 30 19:49 aptitude
drwxr-xr-x 2 root root 4.0K Jun 25 11:44 aspell
drwxrwxr-x 2 root bind 4.0K May 29 00:20 bind
drwxr-xr-x 2 root root 4.0K Jan 11 2012 dbus
drwxr-xr-x 2 root root 4.0K Aug 15 15:53 debfoster
drwxr-xr-x 2 root root 4.0K Aug 15 16:56 deborphan
drwxr-xr-x 7 root root 4.0K Jun 25 11:46 defoma
drwxr-xr-x 2 root root 4.0K Jan 10 2012 dhcp
drwxr-xr-x 4 root root 4.0K Jun 25 11:44 dictionaries-common
drwxr-x--- 2 root root 4.0K Oct 24 21:51 dovecot
drwxr-xr-x 7 root root 4.0K Oct 30 19:49 dpkg
drwxr-xr-x 4 root root 4.0K Jan 31 2012 ghostscript
drwxr-xr-x 2 root root 4.0K Jan 10 2012 initramfs-tools
drwxr-xr-x 2 root root 4.0K Jan 11 2012 initscripts
drwxr-xr-x 2 root root 4.0K Jan 1 2011 insserv
drwxr-xr-x 6 root root 4.0K Sep 10 21:50 jffnms
drwxr-xr-x 2 root root 4.0K Oct 18 2009 john
drwxrwsr-x 2 libuuid libuuid 4.0K Aug 23 20:47 libuuid
drwxrwx--- 2 logcheck logcheck 4.0K Aug 27 22:02 logcheck
drwxr-xr-x 2 root root 4.0K May 19 08:25 logrotate
drwxr-xr-x 2 root root 4.0K Jan 12 2011 lsb
drwxr-xr-x 2 root root 4.0K May 19 00:36 mdadm
drwxr-xr-x 4 root root 4.0K Oct 22 10:52 mibs
drwxr-xr-x 2 root root 4.0K Oct 2 2011 misc
drwxr-xr-x 2 root root 4.0K Oct 31 06:26 mlocate
drwx------ 11 mysql mysql 4.0K Oct 29 15:22 mysql
drwxr-xr-x 2 nagios nagios 4.0K Sep 17 13:04 nagios
drwxr-x--- 4 nagios nagios 4.0K Oct 31 08:22 nagios3
drwxr-xr-x 3 www-data www-data 4.0K Sep 17 21:40 nagvis
drwxr-xr-x 6 statd root 4.0K Oct 29 15:22 nfs
drwxr-xr-x 2 ntp ntp 4.0K Oct 31 08:24 ntp
drwxr-xr-x 2 root root 4.0K Jan 10 2012 os-prober
drwxr-xr-x 2 root root 4.0K Jan 10 2012 pam
drwx-wx-wt 2 root root 4.0K Oct 22 13:39 php5
drwxr-xr-x 2 root root 4.0K Sep 10 22:17 phpmyadmin
drwxr-xr-x 2 root root 4.0K Oct 29 15:23 portsentry
drwxr-xr-x 2 postfix postfix 4.0K Jun 20 00:35 postfix
drwxr-xr-x 2 root root 4.0K Aug 13 21:44 pycentral
drwxr-xr-x 2 root root 4.0K Jul 28 21:42 python
lrwxrwxrwx 1 root root 18 Jan 10 2012 python-support -> /usr/lib/pymodules
drwxr-xr-x 2 root root 4.0K Nov 1 2010 rpm
drwxr-xr-x 5 root root 4.0K Jan 11 2012 samba
drwxr-xr-x 2 root root 4.0K Jan 10 2012 sgml-base
drwxr-xr-x 2 root root 4.0K Dec 26 2010 smartmontools
drwxr-xr-x 2 snmp snmp 4.0K Oct 29 15:23 snmp
drwxr-xr-x 2 root root 4.0K Oct 1 21:47 snort
drwx------ 6 root root 4.0K Jan 1 1985 sudo
drwxr-xr-x 2 root root 4.0K Jan 16 2011 supervise
drwxr-xr-x 3 root root 4.0K Jan 10 2012 tex-common
drwxr-xr-x 3 root root 4.0K Sep 17 21:46 ucf
drwxr-xr-x 2 root root 4.0K Oct 3 21:38 update-rc.d
drwxr-xr-x 2 root root 4.0K Oct 29 15:22 urandom
drwxr-xr-x 2 root root 4.0K Jan 10 2012 usbutils
drwxr-xr-x 3 root root 4.0K May 26 00:58 vblade-persist
drwxr-xr-x 3 root root 4.0K Jan 10 2012 vim
drwxr-xr-x 2 root root 4.0K Jan 31 2012 x11
drwxr-xr-x 2 root root 4.0K Jan 31 2012 xfonts
drwxr-xr-x 2 root root 4.0K Jan 10 2012 xml-core
If you're using your computer as your main driver then you'll probably want to backup the /home directory too.
Please understand it is difficult for me to convey what exactly you should back up because I don't know what you use your system for. You could explain all day how you use your system and I still could not know the full scope.
Why not back up all of var? Here's how big var is on my system...
root@farcry:~# du -shc /var /etc
For me, it's a no brainer to back up all of the /var directory because I have the spare disk space available. There is no such thing as a single backup strategy for all. Perhaps it would be better for me to give you guidelines on how you can effectively back-up your system rather than tell you which specific applications.
List out your currently used applications, constraints, and requirements on pen and paper (or use a text editor).
- Currently used applications would be your mission critical apps. For example, MySQL or Apache or Nagios monitoring etc.
- Constraints are your limiting factors such as the number of hard drives you have to back up to, the size of the hard drives, the free disk space on those hard drives, etc.
- Requirements are things you absolutely require to have backed up. These are things you can't compromise on. This would be something like your own personal source code repository, configurations you heavily customized away from application defaults, etc.
Now with your lists in hand get more detail on each application/item. For example if you run this command to see free disk space...
and you find that you can back up the whole system then just back up or mirror the whole system and be done with it.
If you don't have that ability (due to limited hard drive space) then investigate each application that you use and figure out exactly how you use it. Once you know how you use it figure out the parts of it that may need backing up whether it's user data, meta data, configurations, database backends, and so forth.
For example, if you use MySQL for your application and you don't care about the data in the database then you might not care to back it up since you can just use the schema files and easily recreate the database. Another example, if you're using an application with defaults without customizing it then why bother backing up a default configuration?
In that list you gave me, there are tons of things which I would configure and customize but that doesn't mean that you use it. So giving you an application specific recommendation is not useful for you.
Backups and redundancy are two different things so it's still possible for you to lose your backup if the hard drives fail or say your house is broken into and they steal your computer (along with all the drives). That's why things such as RAID and offsite backups exist. RAID 1 disk mirroring is the best redundancy if you have enough hard drives (and that can be bested with replication to multiple drives). For offsite backups, hopefully you have a friend that you can do this with like you backup your stuff to his drive and he backs up his stuff to your drive.