Use -z and -n in printconf instead of == "" and != ""
This could prevent potential problems when (default) values contain
values special to [, such as -n or -a etc. It seems bash is smart enough
to detect this, but better be safe than sorry.
Remove (useless) s/*/__star__/ replacement in getconf.
It seems this was meant to replace * with __star__ to prevent globbing,
but getconf already handles its values properly so globbing does not
occur. Currently, this replacement was broken due to the double
backslash, causing it to replace a backslash and all following
characters with __star__, instead of a literal *. This is also confirmed
by the fact that some handlers' documentation says to use __star__
instead of * directly in the configuration (and they have special
handling to turn __star__ back into * or something else as appropriate).
Eventually, we should just support using * directly and fixing up all
handling of the variable to not cause any globbing or other expansion
(also because fixing * isn't complete, there is also ? and sometimes ~
and other special characters might be expanded as well).
The printconf function allows getting a variable without clobbering the
global variable with te same name. This can be used for a per-handler
override of a global variable, e.g. local_foo=`printconf "foo" "$foo"`
Previously, once it had found a line continuation backslash, it would
include all subsequent lines, even those after the last line
continuation backslash.
intrigeri [Fri, 8 Jan 2010 22:40:23 +0000 (23:40 +0100)]
ldap,mysql,pgsql: use bash pipefail option so that failed dumps are reported as such
This should fix Redmine bug #1340.
This option makes pipelines return as status the value of the last (rightmost)
command to exit with a non-zero status, or zero if all commands exit
successfully. See bash(1) for details.
E.g. this prevents the following from exiting with status 0 (!) if pg_dumpall
fails:
Silvio Rhatto [Mon, 15 Jun 2009 15:14:01 +0000 (12:14 -0300)]
Enhanced rsync handler.
- Added support for:
- Remote destinations
- Long rotation format similar to maildir handler
- Batch files through --read-batch and --write-batch
- Custom file list using --files-from
- SSH persistent connection using ControlMaster
- The rsync:// protocol
- Metadata folder for each backup folder
- General refactoring
- Code cleanup
Not all options were tested and it might contain bugs.
Tests, comments and patches are welcome. :)
Micah Anderson [Thu, 27 Aug 2009 20:53:43 +0000 (16:53 -0400)]
Standardize the example file format. Making the comments have the same
number of hash marks, clearly specify example settings and what the
defaults are set to.
Micah Anderson [Thu, 9 Jul 2009 23:00:41 +0000 (19:00 -0400)]
added sshoptions variable to the maildir handler for arbitrary options that you might need to pass
updated the example.maildir to include this option, as well as detail the missing desid_file, destport
Previously, there were many indentation styles in use: Real tabs, 2, 3
or 4 spaces, mixing these within the same file, function or even within
a single line.
This commit changes all bash scripts in the handlers, src and lib dirs
to use consistent indentation: three spaces are now used everywhere.
Other files (e.g. Makefiles) are left untouched.
Additionally, this commit removes all trailing whitespace.
Micah Anderson [Sun, 6 Jul 2008 16:05:14 +0000 (16:05 +0000)]
. make maildir helper look in every subdirectory of the source directory for
maildirs, rather than just looking in the directories [a-zA-Z0-9], thanks
for the patch from chris@cenolan.com (Trac#43)
Micah Anderson [Tue, 24 Jun 2008 19:57:31 +0000 (19:57 +0000)]
added more robust mdadm raid device capture, by actually scanning active arrays via mdadm, rather than just catting the mdadm.conf file, which may be empty
Micah Anderson [Tue, 24 Jun 2008 18:57:39 +0000 (18:57 +0000)]
add the ability to save the debconf package selection states in the sys handler, which aides in restoring installed packages with the right choices made
Micah Anderson [Tue, 24 Jun 2008 18:02:23 +0000 (18:02 +0000)]
made mktemp a requirement for building backupninja, added autotools variables to substitute the proper binary location and removed bad fall-back when mktemp was not there