← Back to team overview

holland-discuss team mailing list archive

Re: Generic copy backup plugin?

 

On Thu, Jan 13, 2011 at 4:28 PM, Tim Soderstrom
<tim@xxxxxxxxxxxxxxxxxxxxx> wrote:
> Curious as to thoughts here - what about a generic copy/tar plugin for Holland?

I would suggest instead a general "script/command" plugin. This would
run an arbitrary provided command and fail if the command exits
non-zero.   You can pass the directory to stash files via variable
substitution, for example:

>>> from string import Template
>>> cmd = Template('/bin/tar cvf -C /var/www/images . > ${backupdir}/my_images.tar.gz')
>>> cmd.safe_substitute(backupdir='/var/spool/holland/custom/XXXX_YYYY/')
'/bin/tar cvf -C /var/www/images . >
/var/spool/holland/custom/XXXX_YYYY//my_images.tar.gz'

Then just run that and check the exit status.  There's probably
various other substitutions that may be useful.

With this, you could use rsync or many other archiving tools as you'd
like.  Many simple use cases would fit into this plugin as well, like
just running slapcat and redirecting its output.  You might not need
an ldap plugin at all.

I would probably support using a specific shell (but default to
/bin/sh).   You'll want to deal with the command's stdout/stderr -
probably redirecting that to some location in the backup directory.

Estimating the size can be done in various ways - I would probably
just initially punt on this (estimated_size = 1).   There are many
ways it might be implemented, however.

~Andy



Follow ups

References