(This was originally asked on SuperUser --- they pointed me here as being more appropriate.)
I have a shiny new Debian server running in an Amazon EC2 instance. I've spent a while setting it up and it now works nicely. However, because it's a cloud server, if I (or someone else) presses the wrong button then its virtual hard disk will go pop and I have to do it all over again. So, I want to make backups.
But I'm paying by the byte for storage, so I want to make a small backup.
It should be possible to backup a complete Debian server by recording the set of currently installed packages (which I can do via dpkg --get-selections), the state of the debconf database (which I can do via debconf-get-selections), and then only backing up files that cannot be trivially replaced from the packages --- i.e., everything else. Then restoring the backup should be a matter of reinstalling the packages and dropping the files on top.
The tricky part is determining which files belong to a package and which files don't. Having a static list of subdirectories to backup isn't really good enough due to cruft creep. I need a way to automatically determine whether a particular file needs backing up or not.
This is precisely the sort of thing I don't want to do myself because I'll get it wrong. Are there any tools to allow me to do this?
(Note: I'm not looking for an incremental backup solution. I want to take a complete snapshot.)