Add a hander for 'bup'-based backups

This version is very basic and unfeatureful, but it lets one configure a
local or a remote backup with the help of bup[1].

[1]: https://github.com/apenwarr/bup

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Split user and host configurations and fix debug message

Splitting the two config options should make the 'action.bup'
configuration files easier to understand, and it'll look more like the
rdiff config.

The debug message that showed the remote url parameters currently shows
an empty string (uninitialized variable), since the wrong variable name
is used. Correct the name to actually make the debug message useful.
Refactor: put ssh key generation and installation in library

We'll need to do exactly this with the bup helper, so we want to be
reusing the code.
Refactor: place remote dir verification/creation in library

We'll need to use this code with bup too, so we should be able to reuse
it.
fixup bup.in
Add a config helper for bup
Include bup in the make process and document it.
bup.in: Don't save each directory independantly

index isn't really impacted by this, but running index only once looks
cleaner in the code.

save, on the other hand, shouldn't be called one time for each
directory. this has the effect of creating successive commits that only
contain data from one directory each.
to unify all requested files, we need to specify all the directories on
the one and only call to bup-save.
Finish (almost) bup.helper.in

It's now possible to go through config file creation from A to Z.

There's only one thing missing in there: the remote bup repository
initialization. It must be done, but only on empty directories.

Also, I've implemented file exclusions, although bup.in doesn't support
that, yet. I'll have to ask on bup's mailing list about why bup-save
doesn't have an --exclude option (only bup-index has it).

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
make default includes more specific

most people don't want to backup the whole system.

1) to save space in the backup repository
2) because there are some things that don't deserve to be backed up
   (like temporary files, most spools, and cache files)

Define the list of included directories to match the default critical
spots on debian systems.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Move bupdir to [dest] section

Well, let's be logical, here. The bupdir is the local backup
destination, and it's where you store the local index files when backing
up remotely. So, it has nothing to do with the source of the backup!

Plus: in do_bup_ssh_con() in bup.helper.in, set some more comprehensive
error messages for unset variables.
Also, don't verify emptyness for the remote bupdir variable. This can be
empty for local backups. Better check emtpyness for the local bupdir,
which _needs_ to be set.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Config for remote bup backups doesn't work

When last changing the config option from remote_dir to remote_bupdir, I
forgot to change it in one place: the output to config file in
bup.helper. This was creating config files that would always try to push
in the remote user's home directory (e.g. since the remote dir was
always empty, it would look like this: user@host: )

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Set BUP_DIR instead of an alternate variable

Instant gratification: the BUP_DIR environment variable will tell bup
where to find its repository.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Refactor: move test_connection into the ssh lib

We'll need to test ssh connections for remote backups with bup, too.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Test the ssh connection before running the backup.

This makes it easier to single out SSH connection problems (which would
be exposed by an non-zero return value from bup, but possibly being hard
to point to directly)

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
fixup lib/ssh.in

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Implement pull-type backups with "on" type.

"bup on" means to run bup on a remote server and then send back data to
store it locally.

It is a pull-style method of backing up a server.

It would seem like the $type variable suffers from a side effect at some
point and gets set to '0', so let's use another variable name.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Verify exit code

Set to warning when there was a problem during either the indexing or
saving.

Not seeing the output as soon as it comes out of the command is
annoying, tough.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
fixup backupninja.in: add $BUP config for bup executable

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
bup: Implement version checking

Signed-off-by: Gabriel Filion <lelutin@gmail.com>