Some days (weeks?) ago I told you about the release of „Bashup“ a bourne shell compatible backup script on sourceforge. As the script is still in heave Alpha I’d like to give you a first insight into it’s development.
Bashup is written in heavy Bash syntax and has few dependencies to external programs. You should image it as a scripting library for backups as it allows to call different backup methods and is more a framework than a fully integrated solution. The power of this is the ability to be free in the creation of a backup process while still using easy methods.
The following is a fairly easy setup of bashup for backing up some directories over ssh. You see that we only source the bashup library here, setup some variables and call the bashup method then which executes the backup.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/bin/bash # source bashup lob . bashup_lib.sh # set setup source - we want to backup a tree SOURCE=tree # set source dirs TREE_DIRECTORIES="$HOME/PDF $HOME/ogg" # setup filter for compression FILTER=bzip2 # set destination - we want to ssh DESTINATION=ssh_file # set ssh host, you could be clever # and setup access in .ssh/config SSH_HOST=host.name.tld # set remote file name FILE=file.name.bz2 # we want two types of logging USE_REPORTERS="console log" # set the log file names COMBINED_LOG=combined.log ERROR_LOG=error.log # call bashup bashup
I admit this example won’t win a Noble award but if you are busy with setting up backups on very different servers you might like the idea of a scripting environment which only needs bash. Imagine your power when digging deeper into the bashup lib and calling the special methods directly while piping output and more. This is possible of course.
In the next weeks I’ll show you how to use backup rotation (yes, also over ssh, ftp and other methods), mysql/postresql/oracle/subversion backup, nagios feedback integration and more.
If you like to test and tell me what you think or even want to provide patches, feel free to checkout bashup:
svn co https://bashup.svn.sourceforge.net/svnroot/bashup bashup