From 539fd1471907422d81626260ea4f1e23e4d398a4 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 19 Feb 2009 12:23:29 -0500 Subject: move the branches directories up to the root of the repository --- AUTHORS | 29 + COPYING | 340 ++++ ChangeLog | 509 ++++++ INSTALL | 231 +++ Makefile.am | 45 + Makefile.in | 613 +++++++ NEWS | 33 + README | 263 +++ TODO | 29 + aclocal.m4 | 554 +++++++ autogen.sh | 22 + backupninja.spec.in | 65 + configure | 3529 ++++++++++++++++++++++++++++++++++++++++ configure.in | 79 + debian/NEWS | 36 + debian/backupninja.dirs | 4 + debian/backupninja.examples | 11 + debian/backupninja.manpages | 4 + debian/backupninja.postinst | 17 + debian/backupninja.preinst | 31 + debian/changelog | 562 +++++++ debian/compat | 1 + debian/control | 28 + debian/copyright | 33 + debian/docs | 2 + debian/rules | 79 + etc/Makefile.am | 38 + etc/Makefile.in | 353 ++++ etc/backupninja.conf.in | 88 + etc/cron.d/backupninja.in | 6 + etc/logrotate.d/backupninja.in | 6 + examples/Makefile.am | 9 + examples/Makefile.in | 320 ++++ examples/example.dup | 141 ++ examples/example.ldap | 45 + examples/example.maildir | 58 + examples/example.makecd | 31 + examples/example.mysql | 85 + examples/example.pgsql | 23 + examples/example.rdiff | 120 ++ examples/example.rsync | 127 ++ examples/example.sh | 2 + examples/example.svn | 26 + examples/example.sys | 52 + examples/example.trac | 16 + handlers/Makefile.am | 92 ++ handlers/Makefile.in | 403 +++++ handlers/dup.helper.in | 514 ++++++ handlers/dup.in | 263 +++ handlers/ldap.helper.in | 90 + handlers/ldap.in | 111 ++ handlers/maildir.in | 370 +++++ handlers/makecd.helper.in | 97 ++ handlers/makecd.in | 88 + handlers/mysql.helper.in | 212 +++ handlers/mysql.in | 319 ++++ handlers/pgsql.helper.in | 107 ++ handlers/pgsql.in | 133 ++ handlers/rdiff.helper.in | 407 +++++ handlers/rdiff.in | 257 +++ handlers/rsync.in | 350 ++++ handlers/sh.in | 7 + handlers/svn.in | 77 + handlers/sys.helper.in | 43 + handlers/sys.in | 543 +++++++ handlers/tar.helper.in | 94 ++ handlers/tar.in | 79 + handlers/trac.in | 52 + handlers/wget | 220 +++ install-sh | 519 ++++++ lib/Makefile.am | 29 + lib/Makefile.in | 336 ++++ lib/easydialog.in | 267 +++ lib/parseini.in | 130 ++ lib/tools.in | 48 + lib/vserver.in | 250 +++ man/Makefile.am | 6 + man/Makefile.in | 385 +++++ man/backup.d.5 | 106 ++ man/backupninja.1 | 137 ++ man/backupninja.conf.5 | 134 ++ man/ninjahelper.1 | 62 + missing | 367 +++++ src/Makefile.am | 34 + src/Makefile.in | 343 ++++ src/backupninja.in | 583 +++++++ src/ninjahelper.in | 268 +++ src/ninjareport.in | 205 +++ 88 files changed, 17832 insertions(+) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 README create mode 100644 TODO create mode 100644 aclocal.m4 create mode 100755 autogen.sh create mode 100644 backupninja.spec.in create mode 100755 configure create mode 100644 configure.in create mode 100644 debian/NEWS create mode 100644 debian/backupninja.dirs create mode 100644 debian/backupninja.examples create mode 100644 debian/backupninja.manpages create mode 100644 debian/backupninja.postinst create mode 100644 debian/backupninja.preinst create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100755 debian/rules create mode 100644 etc/Makefile.am create mode 100644 etc/Makefile.in create mode 100644 etc/backupninja.conf.in create mode 100644 etc/cron.d/backupninja.in create mode 100644 etc/logrotate.d/backupninja.in create mode 100644 examples/Makefile.am create mode 100644 examples/Makefile.in create mode 100644 examples/example.dup create mode 100644 examples/example.ldap create mode 100644 examples/example.maildir create mode 100644 examples/example.makecd create mode 100644 examples/example.mysql create mode 100644 examples/example.pgsql create mode 100644 examples/example.rdiff create mode 100644 examples/example.rsync create mode 100644 examples/example.sh create mode 100644 examples/example.svn create mode 100644 examples/example.sys create mode 100644 examples/example.trac create mode 100644 handlers/Makefile.am create mode 100644 handlers/Makefile.in create mode 100644 handlers/dup.helper.in create mode 100644 handlers/dup.in create mode 100644 handlers/ldap.helper.in create mode 100644 handlers/ldap.in create mode 100644 handlers/maildir.in create mode 100644 handlers/makecd.helper.in create mode 100644 handlers/makecd.in create mode 100644 handlers/mysql.helper.in create mode 100644 handlers/mysql.in create mode 100644 handlers/pgsql.helper.in create mode 100644 handlers/pgsql.in create mode 100644 handlers/rdiff.helper.in create mode 100644 handlers/rdiff.in create mode 100644 handlers/rsync.in create mode 100644 handlers/sh.in create mode 100644 handlers/svn.in create mode 100644 handlers/sys.helper.in create mode 100755 handlers/sys.in create mode 100644 handlers/tar.helper.in create mode 100644 handlers/tar.in create mode 100644 handlers/trac.in create mode 100644 handlers/wget create mode 100755 install-sh create mode 100644 lib/Makefile.am create mode 100644 lib/Makefile.in create mode 100644 lib/easydialog.in create mode 100644 lib/parseini.in create mode 100644 lib/tools.in create mode 100644 lib/vserver.in create mode 100644 man/Makefile.am create mode 100644 man/Makefile.in create mode 100644 man/backup.d.5 create mode 100644 man/backupninja.1 create mode 100644 man/backupninja.conf.5 create mode 100644 man/ninjahelper.1 create mode 100755 missing create mode 100644 src/Makefile.am create mode 100644 src/Makefile.in create mode 100755 src/backupninja.in create mode 100755 src/ninjahelper.in create mode 100755 src/ninjareport.in diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..145fa02 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,29 @@ +BACKUPNINJA was written by the Riseup Collective: intellectual property is theft. + +Ninjas: + +elijah@riseup.net -- original code, bug fixes, man pages +micah@riseup.net -- debian package, vserver support, bug fixes +stefani@riseup.net -- makecd handler, man pages +intrigeri@boum.org -- dup handler, pgsql handler, vserver support, bug fixes +Charles Lepple -- trac handler +Petr Klíma -- autotools, RPM support and sys checks +paulv@bikkel.org -- rsnap handler +Robert Napier -- improved RPM build +rhatto -- rub handler and patches + +Patches: + +cmccallum@thecsl.org +Daniel.Bonniot@inria.fr -- mysql ignores and nodata +Brad Fritz -- trac patch +garcondumonde@riseup.net +Martin Krafft madduck@debian.org -- admingroup patch +Anarcat -- lotsa patches +Jamie McClelland -- cstream patches +ale -- ldap cleanup +Sami Haahtinen +Matthew Palmer -- mysql enhancements +romain.tartiere@healthgrid.org -- ldap fixes +Adam Monsen - spec file updates +Matthew Palmer -- halt loglevel feature diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..c968251 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..195bbab --- /dev/null +++ b/ChangeLog @@ -0,0 +1,509 @@ +version 0.9.6 -- July 21, 2008 + backupninja changes + . fix bug in cstream definition, thanks Jamie McClelland + . Allow the entire backup run to be halted by an action, thanks to + Matthew Palmer (Closes: #455836) + . Fixed tr construct reporting a warning (Closes: #452669) + lib changes + vserver: + . added vservers_running function + tools + . mktemp is now required to run backupninja, removed less secure + fall-back if mktemp did not exist on the system + handler changes + dup: + . General cleanup + . Better support for new duplicity (>= 0.4.4) command line syntax: + run remove-older-than when $keep is not set to yes (Closes: #458816), + and run "duplicity cleanup" before any other duplicity command; both + only trigger a warning on failure, since they should not stop backups + from being done. Also migrated full/incremental backup switch to the + new syntax. + . Support every duplicity-supported transport with new configuration + option desturl (Closes: #483712, #346040, Trac#2). + . Actually allow to backup only VServers, by relaxing $include test. + . Set secure permissions on tmpdir when creating it. + ldap: + . support HDB backend just as the BDB one, and make message clearer + when no supported backend is found (Closes: #476910) + rdiff: + . Fixed ignore_version default value missing + . Add patch from Matthew Palmer to rdiff handler to incorporate sshoptions + into options via remote-schema not already specified (Closes: #424639) + wget: + . New handler from rhatto designed to incrementally pull content from + a website to a local folder, based on the rsync handler + maildir: + . fixed bug where maildirs that start with a number were skipped + . 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). + . make deleted maildirs record the date they were deleted + . add destid_file configuration option to enable you to specify an alternate + ssh public key authentication file (defaulting to /root/.ssh/id_rsa) + pgsql, mysql, svn, sys: + . use new vservers_running function from lib/vserver (factorization++) + sys: + . update for 2.6 kernels: use /proc/kallsyms instead of /proc/ksyms + (Closes: Trac#39) + . support selection of VServers to run on, in the same way as in the + dup handler, with the new vsnames configuration option ; (Closes: Trac#45) + . add support for capturing the package debconf selection states using + debconf-get-selections + . fixed catifexec function to actually work, also now passes the arguments + given to catifexec() to the called command (Thanks John Hallam!) + . Added more robust software RAID information capture by running mdadm + -Q --detail /dev/md?* because some people may have empty mdadm.conf files + (Thanks to John Hallam). + trac: + . stop failing on all the trac backups if just one fails, this means + removing the temporary trac backup directories if they fail + makecd + . updated handler for new toolset (genisoimage and wodim) + +version 0.9.5 -- December 2, 2007 + backupninja changes + . Fixed checks on configuration files permissions, since the patch + applied to fix #370396 broke this, especially for configuration files + created with permissions 000 by an older ninjahelper version. + . Enhanced portability for other platforms + . Added quoting because it was needed to prevent shell expansion, broking the + toint function sometimes (Closes: Trac#11) + . Fixed reportspace option (Closes: Trac#10) + . Fixed ldap handler not recognizing database suffix (Closes: Trac#28) + handler changes + dup: + . Support duplicity >= 0.4.3 invocation syntax (--ssh-command option + is not supported anymore) (Closes: #447425) + . New tmpdir configuration option, very useful in case duplicity tends + to fill up /tmp. + ldap: + . Fixed shell command quoting issues, missing 'then' clauses, cleaned up + compress=yes to be less redundant and not create empty uncompressed + file (Closes: #394935) + . Fixed ninjahelper to properly set compress option, standardized on yes/no + instead of on/off + . Fixed problem that caused combination of slapcat and compress to not work + together (Closes: Trac#29) + . Applied patch from romain.tartiere@healthgrid.org to fix the SSL/TLS options + to be correct, also set TLS to be the default over SSL (Closes: Trac#13) + maildir: + . Added an examples file (Closes: Trac#23) + . Applied patch from Anarcat that fixes the cp/mkdir calls to not use GNU + coreutils options, as well as some bashisms (Closes: Trac#24) + . Fix test mode (Closes: Trac#25) + mysql: + . Fixed case where odd combination of configuration options caused sqldump + backups to get overwritten with an empty file (Closes: #402679) + . Added 'nodata' option to enable you to specify tables that you want to omit + the data from a backup, but still backup the table structure. This is very + useful in cases where tables contain large amounts of cache data. See the + example.mysql for options, thanks Daniel Bonniot (Closes: #408829) + . Enhance code for selecting databases by asking MySQL not to give us the + header (-N), to not draw pretty boxes around the output (-B), send the query + via -e instead of a pipe and ensure MySQL listens to -B. Thanks to + Matthew Palmer (Closes: #452039). + pgsql: + . Support configuring PGSQLUSER for real, and document it a bit; this + broken support actually prevented pgsql handler to work for VServers + (Closes: #396578) + rdiff-backup: + . Added cstream support to allow for bandwidth limiting + . Handle "keep = yes" to disable old backups removal (Closes: #424633) + . Add configuration option to allow you to disable the version check + as in some instances this may be an ok scenario (Closes: #424632) + . Added local destination support to helper (Closes: Trac#4) + . Allow exclude-only configurations (Closes: Trac#21) + rub/rsync + . Fixed typo in rub handler that caused it to not work + . Changed to use lib/vserver code + . Fixed fsck error + . Fixed integer comparison (Closes: Trac#3) + . Renamed handler to 'rsync', replaces outdated rub handler + . updated examples/Makefile.am and handlers/Makefile.am to include + rsnap/rsync (Closes: #440554) + . Added example.rsync configuration file + sys: + . Fixed typo breaking things for VServers. + . Fix bug when vrootdir is on its own partition (Closes: #395928) + . Better sfdisk error and output handling: should now properly warn + when it does not manage to backup a partition table, and shut up when + it succeeds (Closes: #396632) + . Added option to not use sfdisk at all, useful for vserver/xen instances + that produce warnings about no harddisks found (Closes: #404071) + . Fixed example in example.sys to detail the __star__ in partitionsfile and + note why its necessary (Closes: #409192) + . Force C locale for sfdisk to ensure english words are found in grep + . Make directory where output is placed configurable, and create the parent dir + if it doesn't exist (Closes: Trac#1) + ninjareport + . Added first draft of method to aggregate reports from many servers into + one email. Requires logtail, rsync, configuration of reporthost, + reportdirectory and reportuser in backupninja.conf. Configure cron to + run once a day, and individual backupninjas not to report by email their + status, then enjoy one email report from all hosts, rather than multiple + fixed 'make install' bug that failed if /etc/backup.d already existed + changed spaces to tabs in Makefile.am + updated redhat spec file (thanks Adam Monsen) + +version 0.9.4 -- October 6th, 2006 + backupninja changes + . Fixed bug in toint(), and thus isnow(), which caused it + to not work when run from cron. + . Recursively ignore subdirs in /etc/backup.d (Closes: #361102) + . Add admingroup option to configuration to allow a group that can + read/write configurations (instead of only allowing root). Checks + and complains about group-readable files only when the group differs + from the one in the configuration file (default is root as before). + Thanks to Martin Krafft for the patch (Closes: #370396). + . When determining which backup actions to make, find now follows + symlinks for $configdirectory + . Changed order of -s to mail for compatibility + . fixed permission stat call so it uses the --format supported by + coreutils (Closes: #382747) + . Added disk space report option (thanks Adam Kosmin) + handler changes + Added tar handler: + . create tarballs + Added rsnap handler: + . rotated rsync snapshops + . code from paulv@bikkel.org + Added rub handler: + . alternative to rsnap + . code from rhatto@riseup.net + mysql: + . Fixed improper use of $vuserhome (Closes: #351083) + . Fixed erroneous removal of tmpfile when it didn't exit + . Fixed inversed vsname emptiness check + . Fixed su quote usage to be more posixy + . Compress for sqldumps now happens in-line to save some disk space (Closes: #370778) + . Fixed --defaults-file now as --defaults-extra-file (thanks rhatto) + pgsql: + . Fixed inversed vsname emptiness check + . Fixed su quote usage to be more posixy + . Fixed shell expansion, thanks Thomas Kotzian (Closes: #363297) + . postgres user UID is now the one from inside the vserver if necessary + . Compress now happens in-line to save some disk space (Closes: #370778) + . $PGSQLUSER is used instead of hardcoding user 'postgres' (although this is the default) + svn: + . Fixed inversed vsname emptiness check + rdiff: + . Symlink and globbing support in include/exclude/vsinclude + clarification: globbing is fully supported again, whereas no attempt + is done to dereference symlinks anymore, due to incompatibilities + between various readlink versions in this field. + . Removed overzealous vsnames check + . Now works if testconnect=no and if $test is not defined. + . add $sshoptions config parameter in [dest] section of config so + connections to ports other than 22 can be made by adding the + following to the top of the handler config: + options = --remote-schema 'ssh -p REMOTE-PORT -C %s rdiff-backup + --server' + dup: + . Symlink and globbing support in include/exclude/vsinclude + clarification: globbing is fully supported again, whereas no attempt + is done to dereference symlinks anymore, due to incompatibilities + between various readlink versions in this field. + . Removed over zealous vsnames check + . Does not pretend anymore that duplicity can work without + any passphrase + . Support duplicity 0.4.2 (with Debian patches applied; upstream's + 0.4.3 will integrate them); documented how to write sftp-compatible + sshoptions (Closes: #388543) + . Now forbid to (try to) include /. + sys: + . Many more system checks were added, (thanks to Petr Klíma) + . Added warning if no devices were found (thanks Ranier Zocholl) + . Enhanced debian package selections to include purged packages (thanks + Tom Hoover) + . Removed warning about vserver not running (thanks anarcat) + ldap: + . Compress now happens in-line to save some disk space (Closes: #370778) + makecd: + . Added nicelevel option (thanks rhatto) + trac: + . fixed problem when src was set to the trac repo directly (Closes: #382737) + lib changes + vserver: + . init_vservers: fixed Debian bug #351083 (improper readlink syntax) + . found_vservers: escaped special grep repetition character + + . forced mktemp to use a template with a name to be more compatible with + different versions of mktemp, thanks anarcat + ninjahelper changes + . Recursively ignore subdirs in /etc/backup.d (Closes: #361102) + . Fix configdirectory error that forced you to use /etc/backup.d, thanks anarcat + . When determining which backup actions to list, find now follows + symlinks for $configdirectory + . Stop checking helpers perms: both "make install" and distros packages + install them with appropriate permissions, it's overzealous to check + this at runtime, and is more complicated to do with current + admingroup option. + dup.helper: + . Fix: signing was enabled with symmetric encryption. + changed cron permissions to 644 + changed /etc/backup.d permissions to 0770 (for admingroup) + minor documentation fixes + improved RPM build process allowing 'make rpm-package' and 'make + srpm-package' targets, also fixes permissions on man directories, + cleans up RPM-related files during distclean, and adds default + EDITOR for "autogen.sh -f" if none is set. (thanks Robert Napier) + +version 0.9.3 -- February 1st, 2006 + autotools fixes + backupninja changes + backupninja.conf + . added (commented out) the various default paths to + programs such as PGSQLDUMP, so that users can figure + out more easily they can customize them + code refactor: + . now uses vservers lib to initialize vservers support + handler changes + duplicity, mysql, pgsql, rdiff, svn, sys: start to use (at different + degrees) new lib/vserver functionality + mysql: + . fixed no user defaults file processing + duplicity: + . fixed (again...) globbing in include and exclude options (Debian bug + #348022, follow-up to #338796) + . warn if vsnames or vsinclude is enabled while vservers support is + disabled in backupninja.conf + . now works when multiple vservers names are given (separated by space) + in vsnames config variable + rdiff + . fixed globbing bug in include, exclude and vsinclude options + . it's now possible to choose exactly which vservers should be + backed-up, as it already was with duplicity handler, with the + "vsnames" configuration setting + ninjahelper changes + rdiff.helper: + . fixed errors in create remote dir + . code formatting cleanup (three spaces indent) + . fixed bug which caused only first include/exclude dir to + have "include = " + . fixed globbing bug with exclude + ninjahelper: + . now reports error if the helper script has a syntax error or bombs out. + . code formatting cleanup (three spaces indent) + lib changes + vserver: + . init_vservers: improved VROOTDIR detection + . init_vservers: test in a stricter way the real vservers availability + . init_vservers: canonicalize VROOTDIR (since duplicity et al. + don't follow symlinks) + . init_vservers: warn if vservers are enabled but no vserver is found + . new function: vservers_exist + known bugs: + easydialog: + . formDisplay does not return exit status. + +version 0.9.2 -- December 29, 2005 + backupninja changes + fixed broken toint() which caused when "everyday" problems + backupninja.conf.5 updated to include "when" and "vservers" + code refactor: + . moved to lib/ some code that has to be shared between + backupninja and ninjahelper + handler changes + trac: + . mkdir subdirectory problem fixed + duplicity: + . globbing support fixed in include and exclude options + . different signing and encrypting key support added + . fixed erroneous comments in example.dup about the way + GnuPG-related options are used + mysql: + . handler vserver bugs fixed and debug output enhanced + ninjahelper(s) changes + vserver-related functions added to lib/vservers.in + added man/ninjahelper.1 man page + makecd: + . was missing in Makefile.am/.in + rdiff-backup: + . used to expand '*' in default source directories + . the "Cancel" buttons used to have a weird behaviour + . updated to include Vserver selection + pgsql: + . forbid the user to choose an empty database set + . "Cancel" button now does what it is meant to do + mysql: + . enhanced for vserver support + . now able to select databases and dump directory + duplicity: + . new handler added (with Vserver support) + +version 0.9.1 -- November 05 2005 + rearranged source so that it is relocatable with autotools + (thanks to Petr Klíma petr.klima@madeta-group.cz) + fixed many bugs in rdiff helper + rdiff handler does not require 'label' (for real this time?) + added makecd ninjahelper + (thanks to Stefani stefani@riseup.net) + made ninjahelper create files with mode 600 rather than 000 + changed subversion handler to use svnadmin hotcopy instead of + the unsupported hot-copy.py script, which was moved in Debian + update rdiff ninjahelper + now detects and auto-install rdiff-backup on the remote + machine if possible, also tests the remote backup directory + and offers to create it if it doesn't exist + +version 0.9 -- October 19 2005 + *** IMPORTANT CHANGE, UPGRADE AT ONCE *** + fixed insecure temporary file creation + ***************************************** + removed erroneous magic file marker in pgsql handler + fixed incorrect find positional + changed direct grep of /etc/passwd to getent passwd. + rdiff helper has much better information on failed ssh attempt + (patch from cmccallum@thecsl.org). + rdiff handler now supports remote source and local dest. + (patch from cmccallum@thecsl.org). + man pages are greatly improved. + +version 0.8 -- September 15 2005 + added pgsql (PostgreSQL) handler, with vservers support. + added vservers support to duplicity handler + Note: the configuration is a bit different than the rdiff + handler's one, but the default behavior is the same: + have a look at example.dup. + improved README + documented .disabled method. + corrected VROOTDIR default value. + added ninjahelper to the install instructions. + improved rdiff, dup and sys handlers' vservers support + prevent vserver-debiantools' $VROOTDIR/ARCHIVES directory + to be seen as a vserver + changes to sys handler + make use of configurable $VSERVERINFO instead of hard-coded vserver-info. + fixed dpkg existence test inside vserver. + fixed $nodpkg use. + changes to pgsql handler + now checks if the specified vserver is running. + now checks if $PGSQLDUMP/$PGSQLDUMPALL are available where needed. + now checks if "postgres" user exists on the host/vserver. + changes to ninjahelper + check_perms() does not die anymore on group/world readable + helper scripts (now consistent with the "helper scripts + must not be group or world writable!" error msg). + xedit action now tries $EDITOR, then /etc/alternatives/editor, + then nano, vim and vi, and aborts if none of these exists. + added helper for pgsql handler. + rdiff handler now does not require 'label' + changes to mysql and svn handlers' vservers support + these handlers now check if the source vserver is running + added 'ignores' for mysql handler. (thanks Daniel.Bonniot@inria.fr) + +version 0.7 -- July 26 2005 + added ninjahelper: a dialog based wizard for creating backupninja configs. + considerably improved and changed the log file output. + you can now disable actions with .disabled (this is new preferred method). + added makecd handler and example.makecd for backing up to cd/dvd (thanks stef). + fixed bug when specifying multiple 'when' options. + +version 0.6 -- June 16 2005 + ldap handler has new options: backup method to use (ldapsearch or + slapcat), restart, passwordfile and binddn. Default backup method + is set to ldapsearch as this is safer + ****************************************************************** + NOTE: to get the previous default behavior with the ldap handler, + you must set "method = slapcat". The new default is ldapsearch. + ****************************************************************** + implemented fix so that the main script will echo fatal errors rather + than being silent about them, this means an error message every hour + if there is a major configuration problem (not a handler problem) + added vserver support to main script and to the handlers: mysql, svn, sys, rdiff + changes to duplicity handler (thanks intrigeri!): + "keep = yes" now disables file cleaning on desthost + added "sign" option for backups signing + added "encryptkey" option to specify the gpg key to use + split config into [source], [gpg] and [dest] sections + added "nicelevel" option + added "testconnect" option + added "sshoptions" option (will be passed to ssh/scp) + added "bandwidthlimit" option + example.dup example config file for duplicity handler + added trac (http://trac.edgewall.com/) environment handler (thanks Charles Lepple!) + added configfile option to mysql handler + the default is /etc/mysql/debian.cnf. with this, + sqldump doesn't need dbusername. (hotcopy still does). + fixed bug in mysql handler which caused some passwords to not work. + (.my.cnf files now have double quotes around password) + can now pass options to hwinfo and sfdisk in sys handler. + +version 0.5 -- April 12 2005 + rdiff handler works when remote sshd has a banner + rdiff handler supports local dest + logfile is created if it doesn't exist + added "when = hourly" + added optional 'nicelevel' to rdiff handler + fixed bug where actions were not run in numeric order. + improved 'when' parsing. + +version 0.4.4 -- March 18 2005 + results of handlers are now read line by line. + changes to rdiff handler: added "options", and "keep" is + not necessarily days now (ie, it will pass straight through to + rdiff-backup if the keep has a unit on it, otherwise it adds the 'D'). + added dup handler (still pretty beta) + added maildir handler (very specialized handler) + added --run option (runs the specified action file) + improved sys handler, now uses hwinfo + added subversion hotbackup handler, svn. + added PATH to cron.d file, which fixes file not found errors. + +version 0.4.2 -- Jan 6 2005 + fixed bug which caused a report email to be sent even if no actions were run. + fixed bug where multiple handler status messages were ignored + added status in the subject line of report emails + +version 0.4.1 -- Jan 3 2005 + added $usecolors and now more conservative about when colors are echoed. + fixed major bug, 'when' actually works now. + replaced debug function with debug, info, warning, error, fatal. + added --now option to force all actions to be performed now. + +version 0.4 -- Dec 26 2004 + added "when" option, so that all configs can specify when + they are to be run. + added reportsuccess and reportwarning config options + added .sys handler (hardware, packages, partitions). + +version 0.3.4 -- Dec 8 2004 + fixed numerical variable quoting compatibility with older wc + fixed stderr redirect bug + some comments in example.rdiff + +version 0.3.3 -- Nov 10 2004 + '*' (asterisk) works now in rdiff config files + works now with gawk as well as mawk + many bug fixes to ldap handler + paths to helper scripts can be configured in global config + does not require /usr/bin/stat + +version 0.3.2 -- Sept 29 2004 + handler scripts are no longer executable (to comply with debian policy) + handler error and warning messages are sent with the notify email + +version 0.3.1 -- Sept 5 2004 + added ldap handler + moved sh support to a handler script + add test mode, where no action is taken. + added --help + force only root can read /etc/backup.d/* + fixed missing equals symbols in example.rdiff + changed backupninja executable to be /usr/sbin rather than /usr/bin + +version 0.3 -- Oct 20 2004 + ** IMPORTANT ** all config files are now ini style, not apache style + rewrote all scripts in bash for portability + added drop-in backupninja lib directory (/usr/share/backupninja) + all scripts are now run as root + +version 0.2 -- Oct 14 2004 + move distribution folder ./cron.d to ./etc/cron.d + fixed bug: removed printr of excludes (!) + added support for changing the user/group in rdiff sources. + added support for .mysql config files. + +version 0.1 -- Oct 8 2004 + initial release + diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..095b1eb --- /dev/null +++ b/INSTALL @@ -0,0 +1,231 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free +Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + +By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PREFIX', the package will +use PREFIX as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..3c50ad9 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,45 @@ +# vi: noexpandtab softtabstop=0 +## Process this file with automake to produce Makefile.in + +EXTRA_DIST = README COPYING AUTHORS INSTALL NEWS ChangeLog \ + backupninja.spec backupninja.spec.in autogen.sh + +SUBDIRS = etc examples handlers lib man src + +local_rpm_topdir=`cd $(top_srcdir) && pwd`/rpm +rpm-package: dist + if test x$(HAVE_RPM) = xyes ; then \ + mkdir -p $(local_rpm_topdir) ; \ + cd $(local_rpm_topdir) ; \ + mkdir -p BUILD RPMS SOURCES SPECS ; \ + cd SOURCES ; \ + $(LN_S) ../../$(distdir).tar.gz ; \ + cd .. ; \ + cd SPECS ; \ + $(LN_S) ../../backupninja.spec . ; \ + cd .. ; \ + rpmbuild --define "_topdir `cd . && pwd`" -bb SPECS/backupninja.spec && \ + echo "Package successfully built in `pwd`/RPMS." ; \ + else \ + echo "Error: RPM executable and/or source directory not found." ; \ + fi + +srpm-package: dist + if test x$(HAVE_RPM) = xyes ; then \ + mkdir -p $(local_rpm_topdir) ; \ + cd $(local_rpm_topdir) ; \ + mkdir -p BUILD SRPMS SOURCES SPECS ; \ + cd SOURCES ; \ + $(LN_S) ../../$(distdir).tar.gz ; \ + cd .. ; \ + cd SPECS ; \ + $(LN_S) ../../backupninja.spec . \ + cd .. ; \ + rpmbuild --define "_topdir `cd . && pwd`" -bs SPECS/backupninja.spec && \ + echo "Package successfully built in `pwd`/SRPMS." ; \ + else \ + echo "Error: RPM executable and/or source directory not found." ; \ + fi + +clean-local: + -rm -rf $(local_rpm_topdir) diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..9ecb717 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,613 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# vi: noexpandtab softtabstop=0 +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/backupninja.spec.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + TODO install-sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = backupninja.spec +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASH = @BASH@ +CFGDIR = @CFGDIR@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +HAVE_RPM = @HAVE_RPM@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKTEMP = @MKTEMP@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_cv_have_rpm = @ac_cv_have_rpm@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = README COPYING AUTHORS INSTALL NEWS ChangeLog \ + backupninja.spec backupninja.spec.in autogen.sh + +SUBDIRS = etc examples handlers lib man src +local_rpm_topdir = `cd $(top_srcdir) && pwd`/rpm +all: all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +backupninja.spec: $(top_builddir)/config.status $(srcdir)/backupninja.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-local mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-local ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ + distclean distclean-generic distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am + +rpm-package: dist + if test x$(HAVE_RPM) = xyes ; then \ + mkdir -p $(local_rpm_topdir) ; \ + cd $(local_rpm_topdir) ; \ + mkdir -p BUILD RPMS SOURCES SPECS ; \ + cd SOURCES ; \ + $(LN_S) ../../$(distdir).tar.gz ; \ + cd .. ; \ + cd SPECS ; \ + $(LN_S) ../../backupninja.spec . ; \ + cd .. ; \ + rpmbuild --define "_topdir `cd . && pwd`" -bb SPECS/backupninja.spec && \ + echo "Package successfully built in `pwd`/RPMS." ; \ + else \ + echo "Error: RPM executable and/or source directory not found." ; \ + fi + +srpm-package: dist + if test x$(HAVE_RPM) = xyes ; then \ + mkdir -p $(local_rpm_topdir) ; \ + cd $(local_rpm_topdir) ; \ + mkdir -p BUILD SRPMS SOURCES SPECS ; \ + cd SOURCES ; \ + $(LN_S) ../../$(distdir).tar.gz ; \ + cd .. ; \ + cd SPECS ; \ + $(LN_S) ../../backupninja.spec . \ + cd .. ; \ + rpmbuild --define "_topdir `cd . && pwd`" -bs SPECS/backupninja.spec && \ + echo "Package successfully built in `pwd`/SRPMS." ; \ + else \ + echo "Error: RPM executable and/or source directory not found." ; \ + fi + +clean-local: + -rm -rf $(local_rpm_topdir) +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..361cf3c --- /dev/null +++ b/NEWS @@ -0,0 +1,33 @@ +backupninja (0.9.4-1) UNRELEASED + + * duplicity: Old (pre-0.9.4) example.dup file used to give false + information about the way the GnuPG-related options are used. + Please read the new /usr/share/doc/backupninja/examples/example.dup + file, and update your own configuration files if needed. + + * duplicity, rdiff: symlinks and globbing support in + include/exclude/vsinclude was unclear and did not work in all + situations, with weird behavious, due to incompatibilities + between various readlink versions in this field. This has been made + clear eventually: globbing is fully supported again, whereas no + attempt is done to dereference symlinks anymore. + Please read the new /usr/share/doc/backupninja/examples/example.dup + or /usr/share/doc/backupninja/examples/example.rdiff file, and update + your own configuration files if needed. + + * duplicity: duplicity now uses sftp, which does not support all scp + command line options; you thus have to convert the sshoptions setting + in your *.dup configuration files, to sftp-compatible syntax; for + example, you can replace: + sshoptions = -i /root/.ssh/id_dsa_duplicity + with: + sshoptions = -o IdentityFile=/root/.ssh/id_dsa_duplicity + +backupninja (0.9.2-1) unstable; urgency=low + +WARNING FOR DUPLICITY USERS + +Old (pre-0.9.2) example.dup file used to give false information about the way +the GnuPG-related options are used. Please read the new example.dup file, and +update your own configuration files if needed. + diff --git a/README b/README new file mode 100644 index 0000000..03d96fe --- /dev/null +++ b/README @@ -0,0 +1,263 @@ + + |\_ + B A C K U P N I N J A /()/ + `\| + + a silent flower blossom death strike to lost data. + +Backupninja allows you to coordinate system backup by dropping a few +simple configuration files into /etc/backup.d/. Most programs you +might use for making backups don't have their own configuration file +format. Backupninja provides a centralized way to configure and +coordinate many different backup utilities. + +Features: + - easy to read ini style configuration files. + - you can drop in scripts to handle new types of backups. + - backup actions can be scheduled + - you can choose when status report emails are mailed to you + (always, on warning, on error, never). + - console-based wizard (ninjahelper) makes it easy to create + backup action configuration files. + - passwords are never sent via the command line to helper programs. + - works with Linux-Vservers (http://linux-vserver.org/) + +Backup types: + - secure, remote, incremental filesytem backup (via rdiff-backup). + incremental data is compressed. permissions are retained even + with an unpriviledged backup user. + - backup of mysql databases (via mysqlhotcopy and mysqldump). + - backup of ldap databases (via slapcat and ldapsearch). + - basic system and hardware info + - encrypted remote backups (via duplicity). + - backup of subversion repositories. + +The following options are available: +-h, --help This usage message +-d, --debug Run in debug mode, where all log messages are + output to the current shell. +-f, --conffile FILE Use FILE for the main configuration instead + of /etc/backupninja.conf +-t, --test Test run mode. This will test if the backup could run, without actually + preforming any backups. For example, it will attempt to authenticate + or test that ssh keys are set correctly. +-n, --now Perform actions now, instead of when they might be scheduled. + No output will be created unless also run with -d. +--run FILE Runs the specified action FILE (e.g. one of the /etc/backup.d/ files). + Also puts backupninja in debug mode. + +CONFIGURATION FILES +=================== + +The general configuration file is /etc/backupninja.conf. In this file +you can set the log level and change the default directory locations. +You can force a different general configuration file with "backupninja +-f /path/to/conf". + +To preform the actual backup, backupninja processes each configuration +file in /etc/backup.d according to the file's suffix: + + .sh -- run this file as a shell script. + .rdiff -- filesystem backup (using rdiff-backup) + .dup -- filesystem backup (using duplicity) + .mysql -- backup mysql databases + .ldap -- backup ldap databases + .pgsql -- backup PostgreSQL databases + .sys -- general hardware, partition, and system reports. + .svn -- backup subversion repositories + .maildir -- incrementally backup maildirs (very specialized) + +Support for additional configuration types can be added by dropping +bash scripts with the name of the suffix into /usr/share/backupninja. + +The configuration files are processed in alphabetical order. However, +it is suggested that you name the config files in "sysvinit style." + +For example: + 00-disabled.ldap + 10-runthisfirst.sh + 20-runthisnext.mysql + 90-runthislast.rdiff + +Typically, you will put a '.rdiff' config file last, so that any +database dumps you make are included in the filesystem backup. +Configurations files with names beginning with 0 (zero) or ending with +.disabled (preferred method) are skipped. + +Unless otherwise specified, the config file format is "ini style." + +For example: + + # this is a comment + + [fishes] + fish = red + fish = blue + + [fruit] + apple = yes + pear = no thanks \ + i will not have a pear. + + +SCHEDULING +========== + +By default, each configuration file is processed everyday at 01:00 (1 +AM). This can be changed by specifying the 'when' option in a config +file. + +For example: + + when = sundays at 02:00 + when = 30th at 22 + when = 30 at 22:00 + when = everyday at 01 <-- the default + when = Tuesday at 05:00 + +A configuration file will be processed at the time(s) specified by the +"when" option. If multiple "when" options are present, then they all +apply. If two configurations files are scheduled to run in the same +hour, then we fall back on the alphabetical ordering specified above. +If two configurations files are scheduled close to one another in +time, it is possible to have multiple copies of backupninja running if +the first instance is not finished before the next one starts. + +Make sure that you put the "when" option before any sections in your +configuration file. + +These values for 'when' are equivalent: + + when = tuesday at 05:30 + when = TUESDAYS at 05 + +These values for 'when' are invalid: + + when = tuesday at 2am + when = tuesday at 2 + when = tues at 02 + + +REAL WORLD USAGE +================ + +Backupninja can be used to implement whatever backup strategy you +choose. It is intended, however, to be used like so: + +(1) First, databases are safely copied or exported to /var/backups. + Typically, you cannot make a file backup of a database while it + is in use, hence the need to use special tools to make a safe copy + or export into /var/backups. + +(2) Then, vital parts of the file system, including /var/backups, are + nightly pushed to a remote, off-site, hard disk (using + rdiff-backup). The local user is root, but the remote user is not + priviledged. Hopefully, the remote filesystem is encrypted. + +There are many different backup strategies out there, including "pull +style", magnetic tape, rsync + hard links, etc. We believe that the +strategy outlined above is the way to go because: (1) hard disks are +very cheap these days, (2) pull style backups are no good, because then +the backup server must have root on the production server, and (3) +rdiff-backup is more space efficient and featureful than using rsync + +hard links. + + +SSH KEYS +======== + +In order for rdiff-backup to sync files over ssh unattended, you must +create ssh keys on the source server and copy the public key to the +remote user's authorized keys file. For example: + + root@srchost# ssh-keygen -t dsa + root@srchost# ssh-copy-id -i /root/.ssh/id_dsa.pub backup@desthost + +Now, you should be able to ssh from user 'root' on srchost to +user 'backup' on desthost without specifying a password. + +Note: when prompted for a password by ssh-keygen, just leave it +blank by hitting return. + +The included helper program "ninjahelper" will walk you through creating +an rdiff-backup configuration, and will set up the ssh keys for you. + +INSTALLATION +============ + +Requirements: + apt-get install bash gawk + +Recommended: + apt-get install rdiff-backup gzip hwinfo + +Files: + /usr/sbin/backupninja -- main script + /etc/cron.d/backupninja -- runs main script nightly + /etc/logrotate.d/backupninja -- rotates backupninja.log + /etc/backup.d/ -- directory for configuration files + /etc/backupninja.conf -- general options + /usr/share/backupninja -- handler scripts which do the actual work + +Installation: + There is no install script, but you just need to move files to the + correct locations. All files should be owned by root. + + # tar xvzf backupninja.tar.gz + # cd backupninja + # mv backupninja /usr/sbin/backupninja + # mv ninjahelper /usr/sbin/ninjahelper + # mv etc/logrotate.d/backupninja /etc/logrotate.d/backupninja + # mv etc/cron.d/backupninja /etc/cron.d/backupninja + # mkdir /etc/backup.d/ + # mv etc/backupninja.conf /etc/backupninja.conf + # mv handlers /usr/share/backupninja + + +VSERVERS +======== + +If you are using Linux-Vservers (http://linux-vserver.org/) there are some +special capabilities that different handlers have to make vserver +backups easier. + +Set the variable "vservers" to be "yes" in /etc/backupninja.conf and see the +example configuration files for each handler to configure the vserver specific +variables. + +Additional vserver variables that can be configured in /etc/backupninja.conf, +but they probably don't need to be changed: + +VSERVERINFO (default: /usr/sbin/vserver-info) +VSERVER (default: /usr/sbin/vserver) +VROOTDIR (default: `$VSERVERINFO info SYSINFO |grep vserver-Rootdir | awk '{print $2}'`) + +NINJAHELPER +=========== + +Ninjahelper is an additional script which will walk you through the process of +configuring backupninja. Ninjahelper has a menu driven curses based interface +(using dialog). + +To add an additional 'wizard' to ninjahelper, follow these steps: + +(1) to add a helper for the handler "blue", create the file + blue.helper in the directory where the handlers live. + (ie /usr/share/backupninja). + +(2) next, you need to add your helper to the global HELPERS variable + and define the main function for your helper (the function name + is always _wizard). for example, blue.helper: + HELPERS="$HELPERS blue:description_of_this_helper" + blue_wizard() { + ... do work here ... + } + +(3) look at the existing helpers to see how they are written. Try to re-use + functions, such as the dialog functions that are defined in easydialog.sh, + or the vserver functions defined in lib/vserver. + +(4) test, re-test, and test again. Try to break the helper by going backwards, + try to think like someone who has no idea how to configure your handler + would think, try to make your helper as simple as possible. Walk like a cat, + become your shadow, don't let your senses betray you. diff --git a/TODO b/TODO new file mode 100644 index 0000000..16ee78c --- /dev/null +++ b/TODO @@ -0,0 +1,29 @@ + +This is a todo list, want to help? Pick something and let the list know +you are working on it! + +. Fix all bugs reported on the Debian BTS: + http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&data=backupninja&archive=no + +. Fix all bugs reported on our Trac: + https://code.autistici.org/trac/backupninja/report/3 + +. Make ninjahelper allow you to pick what type of backup you want (instead + of just assuming you want local-to-remote, or push backups. Some people + want local-to-local, or remote-to-local, or pull backups). This has been + reported for the duplicity handler as Debian bug #346040. + +. Make it so backupninja can be run as a regular user, instead of requiring + root + +. Allow vsnames "all" in the msyql handler. + +. Factorize the rdiff.helper's connection-related functions into a lib, so + that they can be used by dup.helper too. (NB: don't forget that the dup + handler has a sshoptions configuration setting, that is often used to + specify an alternative SSH key, or a specific IP to bind to.) + +. Add an exclude option to database handlers so you can configure it to backup + all databases, except for the excluded ones + +. Consolidate the 'rsnap' and 'rub' handlers into one rsync snapshot handler diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..73ffc5f --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,554 @@ +# generated automatically by aclocal 1.10.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(AC_AUTOCONF_VERSION, [2.61],, +[m4_warning([this file was generated for autoconf 2.61. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 13 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.60])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..aae1061 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +if [ "x$EDITOR" = "x" ]; +then + EDITOR=vi +fi + +if [ "x$1" = "x-f" ] +then + autoscan + [ -f "configure.in" ] && cp "configure.in" "configure.in.old" + mv -f "configure.scan" "configure.in" + echo "## This is just AUTOSCAN draft of configure.in" + $EDITOR "configure.in" +fi + +### použít jen kdyĹľ je tĹ™eba použít configure.h.in +#autoheader + +aclocal \ +&& automake -a -c \ +&& autoconf diff --git a/backupninja.spec.in b/backupninja.spec.in new file mode 100644 index 0000000..917e4de --- /dev/null +++ b/backupninja.spec.in @@ -0,0 +1,65 @@ +%define name @PACKAGE_NAME@ +%define version @PACKAGE_VERSION@ + +Summary: Backupninja backup tool +Name: %{name} +Version: %{version} +Release: 1 +License: GPL +Group: Applications/System +URL: http://dev.riseup.net/backupninja/ +Source: %{name}-%{version}.tar.gz +Requires: bash, gawk, rdiff-backup, gzip +Provides: %{name} +Packager: Petr Klima +BuildRoot: %{_tmppath}/%{name}-%{version} +Prefix: %{_prefix} + +%description +Modular rdiff.backup tool + +%prep +%setup -q + +%build +%configure +make + +%install +rm -rf ${buildroot} +%makeinstall +mkdir -p "%{buildroot}%{_sysconfdir}/backup.d" +mkdir -p "%{buildroot}%{_localstatedir}/backups" +mkdir -p "%{buildroot}%{_localstatedir}/log" +touch "%{buildroot}%{_localstatedir}/log/backupninja.log" + +%clean +rm -fr %{buildroot} + +%files +%defattr(-,root,root,-) +%{_sbindir}/* +%{_datadir}/backupninja/* +%{_libdir}/backupninja/* + +%config %{_sysconfdir}/cron.d/backupninja +%config %{_sysconfdir}/logrotate.d/backupninja + +%config(noreplace) %{_sysconfdir}/backupninja.conf +%dir %{_localstatedir}/backups + +%ghost %{_localstatedir}/log/backupninja.log + +%doc AUTHORS COPYING ChangeLog INSTALL NEWS README +%{_mandir}/man1/* +%{_mandir}/man5/* + +%defattr(0640,root,root,0750) +%dir %{_sysconfdir}/backup.d + + +%changelog +* Sun Oct 14 2007 Adam Monsen 0.9.5-1 +- use cleanup steps during %install and %clean +* Mon Apr 29 2002 Petr Klima 0.7.0 +- first RPM release diff --git a/configure b/configure new file mode 100755 index 0000000..9c3435f --- /dev/null +++ b/configure @@ -0,0 +1,3529 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.61 for backupninja 0.9.6. +# +# Report bugs to . +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME='backupninja' +PACKAGE_TARNAME='backupninja' +PACKAGE_VERSION='0.9.6' +PACKAGE_STRING='backupninja 0.9.6' +PACKAGE_BUGREPORT='backupninja@lists.riseup.net' + +ac_unique_file="src/backupninja.in" +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +am__isrc +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +BASH +SED +MKTEMP +ac_cv_have_rpm +HAVE_RPM +LN_S +CFGDIR +LIBOBJS +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures backupninja 0.9.6 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/backupninja] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of backupninja 0.9.6:";; + esac + cat <<\_ACEOF + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +backupninja configure 0.9.6 +generated by GNU Autoconf 2.61 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by backupninja $as_me 0.9.6, which was +generated by GNU Autoconf 2.61. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" +fi +shift +for ac_site_file +do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +am__api_version='1.10' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_save_IFS + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='backupninja' + VERSION='0.9.6' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +# Checks for programs. + +# BASH may already be set in the shell, if the admin then changes the +# the /bin/sh symlink to a non-bash shell, all hell will break lose. +unset BASH +for ac_prog in bash +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_BASH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $BASH in + [\\/]* | ?:[\\/]*) + ac_cv_path_BASH="$BASH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/bin:/usr/bin:/usr/sbin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +BASH=$ac_cv_path_BASH +if test -n "$BASH"; then + { echo "$as_me:$LINENO: result: $BASH" >&5 +echo "${ECHO_T}$BASH" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$BASH" && break +done +test -n "$BASH" || BASH=""no"" + +if test x$BASH = "xno"; then + { { echo "$as_me:$LINENO: error: bash is required" >&5 +echo "$as_me: error: bash is required" >&2;} + { (exit 1); exit 1; }; } +fi + +for ac_prog in sed +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $SED in + [\\/]* | ?:[\\/]*) + ac_cv_path_SED="$SED" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +SED=$ac_cv_path_SED +if test -n "$SED"; then + { echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$SED" && break +done +test -n "$SED" || SED=""no"" + +if test x$SED = "xno"; then + { { echo "$as_me:$LINENO: error: sed is required" >&5 +echo "$as_me: error: sed is required" >&2;} + { (exit 1); exit 1; }; } +else + export SED +fi + +for ac_prog in awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $AWK in + [\\/]* | ?:[\\/]*) + ac_cv_path_AWK="$AWK" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +AWK=$ac_cv_path_AWK +if test -n "$AWK"; then + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$AWK" && break +done +test -n "$AWK" || AWK=""no"" + +if test x$AWK = "xno"; then + { { echo "$as_me:$LINENO: error: awk is required" >&5 +echo "$as_me: error: awk is required" >&2;} + { (exit 1); exit 1; }; } +else + export AWK +fi + +for ac_prog in mktemp +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_MKTEMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MKTEMP in + [\\/]* | ?:[\\/]*) + ac_cv_path_MKTEMP="$MKTEMP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MKTEMP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +MKTEMP=$ac_cv_path_MKTEMP +if test -n "$MKTEMP"; then + { echo "$as_me:$LINENO: result: $MKTEMP" >&5 +echo "${ECHO_T}$MKTEMP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$MKTEMP" && break +done +test -n "$MKTEMP" || MKTEMP=""no"" + +if test x$MKTEMPT = "xno"; then + { { echo "$as_me:$LINENO: error: mktemp is required" >&5 +echo "$as_me: error: mktemp is required" >&2;} + { (exit 1); exit 1; }; } +fi + +# Extract the first word of "rpm", so it can be a program name with args. +set dummy rpm; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_cv_have_rpm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_cv_have_rpm"; then + ac_cv_prog_ac_cv_have_rpm="$ac_cv_have_rpm" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_cv_have_rpm=""yes"" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_ac_cv_have_rpm" && ac_cv_prog_ac_cv_have_rpm=""no"" +fi +fi +ac_cv_have_rpm=$ac_cv_prog_ac_cv_have_rpm +if test -n "$ac_cv_have_rpm"; then + { echo "$as_me:$LINENO: result: $ac_cv_have_rpm" >&5 +echo "${ECHO_T}$ac_cv_have_rpm" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$ac_cv_have_rpm" = "xyes"; then + rpm --define '_topdir /tmp' > /dev/null 2>&1 + { echo "$as_me:$LINENO: checking to see if we can redefine _topdir" >&5 +echo $ECHO_N "checking to see if we can redefine _topdir... $ECHO_C" >&6; } + if test $? -eq 0 ; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + HAVE_RPM=yes + else + { echo "$as_me:$LINENO: result: no. You'll have to build packages manually." >&5 +echo "${ECHO_T}no. You'll have to build packages manually." >&6; } + HAVE_RPM=no + fi +fi + + +# Extract the first word of "rpm", so it can be a program name with args. +set dummy rpm; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_cv_have_rpm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_cv_have_rpm"; then + ac_cv_prog_ac_cv_have_rpm="$ac_cv_have_rpm" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_cv_have_rpm=""yes"" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_ac_cv_have_rpm" && ac_cv_prog_ac_cv_have_rpm=""no"" +fi +fi +ac_cv_have_rpm=$ac_cv_prog_ac_cv_have_rpm +if test -n "$ac_cv_have_rpm"; then + { echo "$as_me:$LINENO: result: $ac_cv_have_rpm" >&5 +echo "${ECHO_T}$ac_cv_have_rpm" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$ac_cv_have_rpm" = "xyes"; then + rpm --define '_topdir /tmp' > /dev/null 2>&1 + { echo "$as_me:$LINENO: checking to see if we can redefine _topdir" >&5 +echo $ECHO_N "checking to see if we can redefine _topdir... $ECHO_C" >&6; } + if test $? -eq 0 ; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + HAVE_RPM=yes + else + { echo "$as_me:$LINENO: result: no. You'll have to build packages manually." >&5 +echo "${ECHO_T}no. You'll have to build packages manually." >&6; } + HAVE_RPM=no + fi +fi + + +{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6; } +fi + + +CFGDIR="${sysconfdir}" + + +ac_config_files="$ac_config_files Makefile etc/Makefile examples/Makefile handlers/Makefile lib/Makefile man/Makefile src/Makefile" + + +ac_config_files="$ac_config_files backupninja.spec" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by backupninja $as_me 0.9.6, which was +generated by GNU Autoconf 2.61. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +backupninja config.status 0.9.6 +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "handlers/Makefile") CONFIG_FILES="$CONFIG_FILES handlers/Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "backupninja.spec") CONFIG_FILES="$CONFIG_FILES backupninja.spec" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +BASH!$BASH$ac_delim +SED!$SED$ac_delim +MKTEMP!$MKTEMP$ac_delim +ac_cv_have_rpm!$ac_cv_have_rpm$ac_delim +HAVE_RPM!$HAVE_RPM$ac_delim +LN_S!$LN_S$ac_delim +CFGDIR!$CFGDIR$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 68; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; + + + + esac + +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..26e95be --- /dev/null +++ b/configure.in @@ -0,0 +1,79 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +# The maintainer mode is causing me grief with newest versions of autotools +#AM_MAINTAINER_MODE +AC_INIT([backupninja],[0.9.6],[backupninja@lists.riseup.net]) +AC_CONFIG_SRCDIR([src/backupninja.in]) +AM_INIT_AUTOMAKE + +# Checks for programs. + +# BASH may already be set in the shell, if the admin then changes the +# the /bin/sh symlink to a non-bash shell, all hell will break lose. +unset BASH +AC_PATH_PROGS(BASH, bash, "no", [$PATH:/bin:/usr/bin:/usr/sbin]) +if test x$BASH = "xno"; then + AC_MSG_ERROR([bash is required]) +fi + +AC_PATH_PROGS(SED, sed, "no") +if test x$SED = "xno"; then + AC_MSG_ERROR([sed is required]) +else + export SED +fi + +AC_PATH_PROGS(AWK, awk, "no") +if test x$AWK = "xno"; then + AC_MSG_ERROR([awk is required]) +else + export AWK +fi + +AC_PATH_PROGS(MKTEMP, mktemp, "no") +if test x$MKTEMPT = "xno"; then + AC_MSG_ERROR([mktemp is required]) +fi + +AC_CHECK_PROG(ac_cv_have_rpm, rpm, "yes", "no") +if test "x$ac_cv_have_rpm" = "xyes"; then + rpm --define '_topdir /tmp' > /dev/null 2>&1 + AC_MSG_CHECKING(to see if we can redefine _topdir) + if test $? -eq 0 ; then + AC_MSG_RESULT(yes) + HAVE_RPM=yes + else + AC_MSG_RESULT(no. You'll have to build packages manually.) + HAVE_RPM=no + fi +fi +AC_SUBST(HAVE_RPM) + +AC_CHECK_PROG(ac_cv_have_rpm, rpm, "yes", "no") +if test "x$ac_cv_have_rpm" = "xyes"; then + rpm --define '_topdir /tmp' > /dev/null 2>&1 + AC_MSG_CHECKING(to see if we can redefine _topdir) + if test $? -eq 0 ; then + AC_MSG_RESULT(yes) + HAVE_RPM=yes + else + AC_MSG_RESULT(no. You'll have to build packages manually.) + HAVE_RPM=no + fi +fi +AC_SUBST(HAVE_RPM) + +AC_PROG_LN_S + +AC_SUBST([CFGDIR], "${sysconfdir}") + +AC_CONFIG_FILES([Makefile + etc/Makefile + examples/Makefile + handlers/Makefile + lib/Makefile + man/Makefile + src/Makefile]) + +AC_OUTPUT([ backupninja.spec]) diff --git a/debian/NEWS b/debian/NEWS new file mode 100644 index 0000000..7b0b76e --- /dev/null +++ b/debian/NEWS @@ -0,0 +1,36 @@ +backupninja (0.9.4-1) unstable; urgency=low + + * duplicity: Old (pre-0.9.4) example.dup file used to give false + information about the way the GnuPG-related options are used. + Please read the new /usr/share/doc/backupninja/examples/example.dup + file, and update your own configuration files if needed. + + * duplicity, rdiff: symlinks and globbing support in + include/exclude/vsinclude was unclear and did not work in all + situations, with weird behavious, due to incompatibilities + between various readlink versions in this field. This has been made + clear eventually: globbing is fully supported again, whereas no + attempt is done to dereference symlinks anymore. + Please read the new /usr/share/doc/backupninja/examples/example.dup + or /usr/share/doc/backupninja/examples/example.rdiff file, and update + your own configuration files if needed. + + * duplicity: duplicity now uses sftp, which does not support all scp + command line options; you thus have to convert the sshoptions setting + in your *.dup configuration files, to sftp-compatible syntax; for + example, you can replace: + sshoptions = -i /root/.ssh/id_dsa_duplicity + with: + sshoptions = -o IdentityFile=/root/.ssh/id_dsa_duplicity + + -- Micah Anderson Fri, 6 Oct 2006 13:04:45 -0600 + +backupninja (0.9.2-1) unstable; urgency=low + + WARNING FOR DUPLICITY USERS + + Old (pre-0.9.2) example.dup file used to give false information about the way + the GnuPG-related options are used. Please read the new example.dup file, and + update your own configuration files if needed. + + -- Micah Anderson Thu, 29 Dec 2005 14:21:48 -0500 diff --git a/debian/backupninja.dirs b/debian/backupninja.dirs new file mode 100644 index 0000000..db0d7d4 --- /dev/null +++ b/debian/backupninja.dirs @@ -0,0 +1,4 @@ +usr/lib +usr/sbin +usr/share/backupninja +etc/backup.d diff --git a/debian/backupninja.examples b/debian/backupninja.examples new file mode 100644 index 0000000..27faba0 --- /dev/null +++ b/debian/backupninja.examples @@ -0,0 +1,11 @@ +examples/example.dup +examples/example.svn +examples/example.sys +examples/example.rdiff +examples/example.sh +examples/example.mysql +examples/example.ldap +examples/example.makecd +examples/example.trac +examples/example.pgsql +debian/backupninja/etc/backupninja.conf diff --git a/debian/backupninja.manpages b/debian/backupninja.manpages new file mode 100644 index 0000000..71010b2 --- /dev/null +++ b/debian/backupninja.manpages @@ -0,0 +1,4 @@ +debian/backupninja/usr/share/man/man1/backupninja.1 +debian/backupninja/usr/share/man/man5/backupninja.conf.5 +debian/backupninja/usr/share/man/man5/backup.d.5 +debian/backupninja/usr/share/man/man1/ninjahelper.1 diff --git a/debian/backupninja.postinst b/debian/backupninja.postinst new file mode 100644 index 0000000..89c991d --- /dev/null +++ b/debian/backupninja.postinst @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# Automatically added by dh_installmenu +if [ "$1" = "configure" ] +then + chmod 770 /etc/backup.d +fi + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/backupninja.preinst b/debian/backupninja.preinst new file mode 100644 index 0000000..21596aa --- /dev/null +++ b/debian/backupninja.preinst @@ -0,0 +1,31 @@ +#!/bin/sh -e + +# Remove the erroneous /etc/logrotate.d/backupninja directory if it exists + +if [ -d /etc/logrotate.d/backupninja ] +then + rm -f /etc/logrotate.d/backupninja/backupninja + rmdir /etc/logrotate.d/backupninja + if [ $? -ne 0 ] + then + cat << EOF + +The /etc/logrotate.d/backupninja directory was created incorrectly by an earlier +version of this package. When trying to remove this directory file(s) were found +inside this directory. There should be no files in this directory at all. +Installation of this package will not proceed until you have cleaned this +directory out. + +EOF + + exit 1 + fi +fi + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..379833d --- /dev/null +++ b/debian/changelog @@ -0,0 +1,562 @@ +backupninja (0.9.6-4) unstable; urgency=low + + * Fix df error message from cron (Closes: #497535) + * Removed Lenny unsupported desturl example (Closes: #507679) + * Fixed Lintain warning: maintainer-script-ignores-errors preinst + + -- Micah Anderson Mon, 08 Dec 2008 09:41:22 -0500 + +backupninja (0.9.6-3) unstable; urgency=low + + * Removed configure.ac and regenerate the autoconf junk so + that substitution variables get set properly (Closes: #494728) + + -- Micah Anderson Fri, 25 Jul 2008 16:19:54 -0400 + +backupninja (0.9.6-2) unstable; urgency=low + + * Update makecd handler to work with toolset in lenny + * Fix debian/control to Suggest the correct makecd toolset + + -- Micah Anderson Fri, 25 Jul 2008 16:15:48 -0400 + +backupninja (0.9.6-1) unstable; urgency=medium + + * Reduce build-dependency on automake1.9 to just automake + * Added Suggests on debconf-utils so the debconf-get-selections will be + run in the sys hander to capture package debconf selection states + * Add mdadm as a Suggests for sys handler RAID information gathering + * Upgrade to standards version 3.8.0 (no changes) + * Change debian/control to use MySQL spelling for lintian + * Change debian/control to use cdrkit instead of mkisofs and cdrecord + * New upstream release + . Fix CSTREAM definition in backupninja + . Allow entire backup to be halted by an action (Closes: #455836) + . Fixed tr warnings (Closed: #452669) + . added vservers_running function + . removed fall-back for missing mktemp + . General cleanup in dup handler, added support for newer duplicity lenny + . Run remove-older in dup when $keep is not set to yes (Closes: #458816) + . Run duplicity cleanup before any other command + . Support every duplicity-supported transport with new config option + desturl (Closes: #483712, #346040) + . Relax duplicty $include test to allow for backups of Vservers + . Set secure permissions on tmpdir in duplicity when it is created + . Add support to HDB backend (Closes: #476910) + . Fixed ignore_version rdiff default value + . Add sshoptions for unspecified remote-schema (Closes: #424639) + . Added wget handler + . ixed bug where maildirs that start with a number were skipped + . Make maildir helper look ini every subdirectory of source directory + . Make deleted maildirs record date they were deleted + . Add destid_file config option or alternate ssh pubkey auth file maildir + . Update sys handler to be more smart for 2.6 kernels + . Support sys selection of VServers to run on + . Capture package debconf selection states during debconf-get-selections + . Fixed catifexec function to work properly in sys handler + . Added more robust software RAID information capture via mdadm info + . Stop failing on trac backups if just one fails + + -- Micah Anderson Mon, 21 Jul 2008 17:02:15 -0400 + +backupninja (0.9.5-3) unstable; urgency=low + + * Add improved duplicity support (>= 0.4.4) command line syntax: + . run remove-older-than when $keep is not set to yes (Closes: #458816), + . and run "duplicity cleanup" before any other duplicity command + . full/incremental backup switch also migrated to the new syntax. + * Remove versioned Suggest on duplicity + * Add patch from Matthew Palmer to rdiff handler to incorporate sshoptions + into options via remote-schema not already specified (Closes: #424639) + * Fixed Vcs-Svn field (Closes: #455814) + + -- Micah Anderson Wed, 16 Jan 2008 15:44:13 -0500 + +backupninja (0.9.5-2) unstable; urgency=low + + * Fixed ignore_version default value in rdiff handler + * Updated standards version to 3.7.3 (no changes) + * Removed unused /usr/bin from debian/backupninja.dirs + + -- Micah Anderson Wed, 05 Dec 2007 15:42:47 -0500 + +backupninja (0.9.5-1) unstable; urgency=low + + * Added etc/backup.d to debian/backupninja.dirs (Closes: #452666) + * Added Homepage and Vcs-Svn fields to debian/control + * Fixed tr construct reporting a warning (Closes: #452669) + * Add depends on mailx | mailutils (Closes: #452670) + * New upstream release + . ldap quoting, compress=yes now doesn't create empty files (Closes: #394935) + . fixed mysql config combination empty file problem (Closes: #402679) + . added 'nodata' to mysql to backup only table structure (Closes: #408829) + . removed mysqldump header in selecting databases, and cleanup (Closes: #452039) + . Fix broken PGSQLUSER support (Closes: #396578) + . Handle 'keep = yes' rdiff-backup option to disable backup removal (Closes: #424633) + . Allow for rdiff-backup version check override (Closes: #424632) + . rsnap/rub merged to rsync, added to Makefile.am (Closes: #440554) + . Fix bug in sys handler where vrootdir is on its own partition (Closes: #395928) + . Enhance sfdisk error and output handling in sys handler (Closes: #396632) + . Allow for disabling sfdisk in sys handler, useful for xen/vserver (Closes: #404071) + . Add details in example.sys about how __star__ works (Closes: #409192) + . Support duplicity => 0.4.3 invocation syntax, no more --ssh-command (Closes: #447425) + * Added missing parameter in documentation and example file for rsync handler + * Added /tmp dir config option for duplicity + * Add fix from r523 for duplicity handler + * Add version restriction to duplicity Suggests because backupninja's + duplicity handler doesn't support 0.4.4 + + -- Micah Anderson Sat, 10 Nov 2007 21:13:29 -0500 + +backupninja (0.9.4-6) unstable; urgency=high + + * Version number bump to get the regression from last upload resolved + + -- Micah Anderson Thu, 14 Dec 2006 23:09:14 -0700 + +backupninja (0.9.4-5) unstable; urgency=high + + * Fixed case where odd combination of configuration options caused sqldump + backups to get overwritten with an empty file (Closes: #402679) + + -- Micah Anderson Wed, 1 Nov 2006 15:31:19 -0700 + +backupninja (0.9.4-4) unstable; urgency=high + + * Fix vrootdir bug in sys handler (Closes: #395928) + * Fix typo in sys handler that broke vserver handling + * Fix for config file permissions handling + * Enhance sfdisk error/output handling, now warns when it cannot + backup a partition table, and stays quiet when it can (Closes: #396632) + * Fix support for configuring PGSQLUSER for real this time, and document it, + previously this broke pgsql handling for vservers (Closes: #396578) + * Fix rub fsck error, also changed to use internal vserver libraries + * Fix missing binary-arch target in debian/rules (Closes: #395578) + * Urgency set to high to fix RC bugs + + -- Micah Anderson Fri, 13 Oct 2006 18:33:34 -0600 + +backupninja (0.9.4-3) unstable; urgency=medium + + * Added postinst to fix perms on /etc/backup.d (Closes: #392525) + * Added fix from upstream to make rub handler work + + -- Micah Anderson Sat, 7 Oct 2006 19:14:32 -0600 + +backupninja (0.9.4-2) unstable; urgency=medium + + * Fix configuration file permission checks, patch applied + to fix #370396 broke this, medium urgency as this keeps things from + working + * Fix sys handler typo which broke Linux-Vserver handling + * Automake pre-existing /etc/backup.d fix + + -- Micah Anderson Sat, 7 Oct 2006 18:58:42 -0600 + +backupninja (0.9.4-1) unstable; urgency=medium + + * New upstream release (0.9.4) + . admingroup config option (Closes: #370396) + . stat call fixes (Closes: #382747) + . sqldump compress in-line (Closes: #370778) + . fixed shell expansion (Closes: #363297) + . fixed src set to the trac repo directly (Closes: #382737) + . many other fixes, new handlers and changes, see upstream Changelog + * added AUTHORS to debian/docs + * debian build changes to change with upstream + * bumped standards version to current (no changes) + -- Micah Anderson Fri, 6 Oct 2006 13:04:45 -0600 + +backupninja (0.9.3-7) UNRELEASED; urgency=low + + * Removed example files from /usr/share/backupninja (Closes: #371858) + + -- Micah Anderson Sat, 8 Apr 2006 17:04:12 -0400 + +backupninja (0.9.3-6) unstable; urgency=high + + * Recursively ignore subdirs in /etc/backup.d (Closes: #361102) + * Fix overzealous su quoting in mysql handler causing breakage + * Make a vegan cake for intrigeri + + -- Micah Anderson Wed, 5 Apr 2006 00:54:46 -0400 + +backupninja (0.9.3-5) unstable; urgency=medium + + * Brought in changes from upstream to fix various issues: + . Fixed erroneous removal of tmpfile in mysql handler + . Fixed inversed vsname emptiness check in mysql handler + . Fixed su quote usage to be more posixy (Closes: #358995) + . Fixed improper include/exclude symlink dereference in + rdiff-backup and dup handlers + . found_vservers: escaped special grep repetition character + + . Add some additional default excludes (Closes: #353412) + . Remove over zelous vsnames check (Closes: #360485) + + -- Micah Anderson Fri, 3 Feb 2006 14:54:46 -0500 + +backupninja (0.9.3-4) unstable; urgency=low + + * Fixed improper use of $vuserhome in mysql handler (Closes: #351083) + + -- Micah Anderson Fri, 3 Feb 2006 14:41:05 -0500 + +backupninja (0.9.3-3) unstable; urgency=low + + * Fixed improper readlink syntax (Closes: #351083) + * Included fixes to mysql, pgsql, and svn handlers to also fix inverted + vsname test + + -- Micah Anderson Wed, 1 Feb 2006 13:14:56 -0500 + +backupninja (0.9.3-2) unstable; urgency=low + + * Small change to mysql helper to invert vserver vsname test + + -- Micah Anderson Tue, 31 Jan 2006 14:49:32 -0500 + +backupninja (0.9.3-1) unstable; urgency=low + + * New upstream release + . autotools fixes (Closes: #346303) + . backupninja.conf gets default paths added for clarity + . vservers lib functions expanded into backupninja and handlers + . fixed globbing in include/exclude in duplicity and rdiff handlers + (Closes: #348022) + . warnings if vsnames or vsincludes are enabled but vserver support + is enabled in backupninja.conf + . multiple vsnames in configs now functional + . rdiff handler now can have configured exactly which vservers should be + backed up + . ninjahelper now reports an error if the helper script has a syntax error + . lib/vserver improvements in testing VROOTDIR, availability and + proper canonicalization, as well as adding vservers_exist and some + warnings + + -- Micah Anderson Thu, 19 Jan 2006 19:21:51 -0500 + +backupninja (0.9.2-3) unstable; urgency=low + + * Pulled in some fixes from upstream for rdiff.helper ninjahelper: + . fixed errors in create remote dir + . code formatting cleanup (three spaces indent) + . fixed bug which caused only first include/exclude dir to + have "include = " + . fixed globbing bug with exclude + + -- Micah Anderson Tue, 3 Jan 2006 11:20:24 -0500 + +backupninja (0.9.2-2) unstable; urgency=low + + * Fixed no user defaults file mysql handler problem + + -- Micah Anderson Thu, 29 Dec 2005 15:31:22 -0500 + +backupninja (0.9.2-1) unstable; urgency=low + + * New upstream release + . Update backupninja.conf.5 man page to include "when" + and "vservers" (Closes: #338512) + . Updated debian/control to Depend: on bash (Closes: #338795) + . Fixed broken toint() causing backups not to run when set to "everyday" + (Closes: #341881) + . Trac handler mkdir subdirectory problem fixed (Closes: #344156) + . Ninjahelper rdiff-backup fixes + . Linux-Vserver related functions added for ninjahelper + . New Linux-Vserver related functions added to dup and pgsql helpers + . Code re-factoring to make shared functions more available + . Pgsql and mysql helper bugfixes + . Duplicity handler fixed globbing support in include and exclude options + (Closes: #338796) + . Duplicity ninjahelper added (Closes: #340640) + . Ninjahelper man page added (Closes: #341239) + . Remove compat setting from debian/rules + . Fix debian/NEWS file to be the standard format + + -- Micah Anderson Thu, 29 Dec 2005 14:21:48 -0500 + +backupninja (0.9.1-1) unstable; urgency=low + + * New upstream release + . New autotools installation method + . rdiff ninjahelper significantly improved (Closes: #335966) + . makecd ninjahelper added + . ninjahelper generated files now created with more sane + permissions (Closes: #336992) + . subversion handler now uses svnadmin hotcopy (Closes: #336994) + + -- Micah Anderson Sat, 29 Oct 2005 00:28:00 -0400 + +backupninja (0.9-1) unstable; urgency=low + + * Upgraded to the new release + . Upstream includes fix for CAN-2005-3111 (fixed in 0.8-2) + . fixed incorrect find positional + . changed direct grep of /etc/passwd to getent passwd. + . rdiff helper has much better information on failed ssh attempt + (patch from cmccallum@thecsl.org). + . rdiff handler now supports remote source and local dest. + (patch from cmccallum@thecsl.org). + . man pages are greatly improved (also new backup.d.5 man page) + + * Updated debian/backupninja.manpages for new location and man pages + * Updated debian/backupninja.examples to include pgsql example + and to adjust for new location of files in upstream + * Updated debian/rules dh_installchangelogs for new upstream location + * Updated debian/docs for new upstream location of README + + -- Micah Anderson Tue, 11 Oct 2005 00:01:17 -0400 + +backupninja (0.8-2) unstable; urgency=high + + * Fix for insecure temporary file creation + + -- Micah Anderson Wed, 28 Sep 2005 10:49:15 -0400 + +backupninja (0.8-1) unstable; urgency=low + + * Upgraded to new upstream release + . pgsql handler added + . vserver support expanded to duplicity, pgsql + . vserver support improved in mysql, svn, rdiff, dup and sys handlers + . added ninjahelper, .disabled information to documentation + . sys handler improved + . permission checks enhancements + . added 'ignores' for mysql handler + * Added duplicity to Suggests + * Updated package description so it lists the different methods backupninja + is aware of + * Removed erroneous magic file marker in pgsql handler + * Changed FSF address in debian/copyright + + -- Micah Anderson Tue, 27 Sep 2005 21:16:48 -0400 + +backupninja (0.7-2) unstable; urgency=low + + * Fixed broken vserver element of the sys handler + * fixed bug when specifying multiple 'when' options + + -- Micah Anderson Mon, 18 Jul 2005 14:58:44 -0500 + +backupninja (0.7-1) unstable; urgency=low + + * New upstream release: + . vserver support added to handlers + . handlers can now be disabled by changing their name to have .disabled + . duplicity handler improved + . trac handler added (Closes: #310437) + . makecd DVD/CD burner handler added (Closes: #317356) + . mysql handler updated + . ninjahelper curses 'wizard' added to aid in setting up configs + . logfile output improved + . configfile option added to mysql handler (Closes: #305870) + * Added makecd, duplicity and svn handler to examples + * Added suggests on mkisofs, cdrecord, dvd+rw-tools for makecd handler + * Updated Standards-Version to 3.6.2 + * Added dialog to debian/control Depends for ninjahelper + + -- Micah Anderson Fri, 3 Jun 2005 17:34:48 -0500 + +backupninja (0.5-3) unstable; urgency=medium + + * Implemented fix to cause fatal errors in the backupninja script itself + to be reported, rather than be silently ignored (Closes: #307620) + + -- Micah Anderson Thu, 21 Apr 2005 13:57:25 -0500 + +backupninja (0.5-2) unstable; urgency=high + + * Added patches to enhance ldap backend, default backup method + now uses ldapsearch instead of slapcat, required configuration + options include passwordfile and binddn to work with ldapsearch. + See the options in the examples/example.ldap (Closes: #305535) + + -- Micah Anderson Sun, 17 Apr 2005 19:22:13 -0500 + +backupninja (0.5-1) unstable; urgency=medium + + * New upstream release + + -- Micah Anderson Sun, 17 Apr 2005 19:14:33 -0500 + +backupninja (0.4.4-2) unstable; urgency=medium + + * Added minor patch to fix configs in /etc/backup.d not being processed + in numerical order. + + -- Micah Anderson Thu, 24 Mar 2005 12:51:05 -0600 + +backupninja (0.4.4-1) unstable; urgency=low + + * New upstream release: + . Fixes pathing problem causing sfdisk not to be found (Closes: #297091) + . Adds some new experimental handlers and options to existing handlers + . Fixes the terminal escape sequences bug by adding a configuration option + to turn these off (Closes: #285939) + * Added Suggests on hwinfo + * Changed copyright to reflect upstream svn repo path change and + new address + * Added patch to fix duplicate root problem with the mysql + handler (Closes: #300717) + * Added patch to fix svn handler always reporting a failure + + -- Micah Anderson Tue, 15 Mar 2005 00:54:12 -0600 + +backupninja (0.4.2-4) unstable; urgency=low + + * Removed dependency on sfdisk, its included with util-linux nowdays + + -- Micah Anderson Thu, 13 Jan 2005 17:24:20 -0600 + +backupninja (0.4.2-3) unstable; urgency=low + + * Fixed new lintian errors + + -- Micah Anderson Thu, 13 Jan 2005 10:46:07 -0600 + +backupninja (0.4.2-2) unstable; urgency=low + + * Upgraded to latest upstream release, see NEWS for new debugging + and scheduling changes (Closes: #285939) + * Updated man pages to reflect new changes to upstream. + * Fixed install of logrotate config being installed into a directory, + also removed dh_installlogrotate from debian/rules since it wasn't + being used. + + -- Micah Anderson Wed, 12 Jan 2005 11:17:59 -0600 + +backupninja (0.4-1) unstable; urgency=low + + * Upgraded to latest upstream release + * Added example.sys to be installed into examples directory + * Added Suggests on sfdisk and discover + * Updated man pages to have scheduling information + + -- Micah Anderson Sat, 1 Jan 2005 09:57:57 -0600 + +backupninja (0.3.4-1) unstable; urgency=low + + * New upstream release, more compatible with older coreutils in woody + * Put backupninja.conf in examples (Closes: #282575) + + -- Micah Anderson Sun, 5 Dec 2004 21:26:43 -0600 + +backupninja (0.3.3-2) unstable; urgency=low + + * Added backupninja and backupninja.conf manual pages, penned + by the sword of Stefani, thanks! + + -- Micah Anderson Mon, 22 Nov 2004 18:09:24 -0600 + +backupninja (0.3.3-1) unstable; urgency=low + + * Modified description in debian/control + * Dependency on awk can now be satisfied by gawk or mawk + * Removed dependency on stat or coreutils + * Upgraded to latest version (Closes: #282360) + + -- Micah Anderson Mon, 22 Nov 2004 12:04:40 -0600 + +backupninja (0.3.2-2) unstable; urgency=low + + * handler error and warning messages are sent with the notify email + + -- Micah Anderson Wed, 17 Nov 2004 16:02:24 -0600 + +backupninja (0.3.2-1) unstable; urgency=low + + * Added dependency on stat (woody) or coreutils (sarge) + * Updated copyright page to include the svn repository + * Upgraded to 0.3.2, solving the handler executable problem + + -- Micah Anderson Sun, 14 Nov 2004 17:11:53 -0600 + +backupninja (0.3.1-4) unstable; urgency=low + + * Changed the copyright page to list the correct URL (Closes: #280488) + + -- Micah Anderson Thu, 11 Nov 2004 19:20:32 -0600 + +backupninja (0.3.1-3) unstable; urgency=low + + * Fixed the example.rdiff to have the proper equals signs in the + includes + * Changed cron.d/backupninja to call backupninja from /usr/sbin instead + of /usr/bin, also changed install to put it there instead + + -- Micah Anderson Tue, 9 Nov 2004 17:05:22 -0800 + +backupninja (0.3.1-2) unstable; urgency=low + + * Added example.ldap config for doing backups of ldap data + * Made short description more descriptive, and less creative, the + muse cries. (Closes: #280294) + * Fixed the incorrect URL specified in the copyright file. (Closes: #280488) + + -- Micah Anderson Sat, 6 Nov 2004 11:52:04 -0800 + +backupninja (0.3.1-1) unstable; urgency=low + + * New upstream source + * Removed dependencies on php and pear libraries, new version is + bash only + + -- Micah Anderson Sat, 06 Nov 2004 11:10:35 -0800 + +backupninja (0.2-1) unstable; urgency=low + + * Updated from upstream source + * Added example for mysql backups + + -- Micah Anderson Tue, 12 Oct 2004 15:35:57 -0500 + +backupninja (0.1-6) unstable; urgency=low + + * Removed dh_installlogroate and do it in dh_install instead + + -- Micah Anderson Mon, 11 Oct 2004 14:33:36 -0500 + +backupninja (0.1-5) unstable; urgency=low + + * Changed Recommends of rdiff-backup to Suggests after closer + reading of the differences. + + -- Micah Anderson Sun, 10 Oct 2004 23:19:07 -0500 + +backupninja (0.1-4) unstable; urgency=low + + * Added dependency on php-xml-util and php-config now that I've made + these packages. I've also removed the README.Debian file which was + only used to describe how to install these things. + + -- Micah Anderson Sun, 10 Oct 2004 22:48:30 -0500 + +backupninja (0.1-3) unstable; urgency=low + + * Added dependency on php4-pear + * Fixed installation of cronjob by removing dh_installcron and simply + installing the cronjob into cron.d + * Fixed incorrect creation of /etc/backup.d + + -- Micah Anderson Sun, 10 Oct 2004 18:48:19 -0500 + +backupninja (0.1-2) unstable; urgency=low + + * Added Recommends for rdiff-backup + * Added dependency on logrotate + * Added text to the README.Debian to describe the necessary PEAR + installation, this will be removed before package is uploaded + because PEAR modules will be also uploaded at that time. + + -- Micah Anderson Sun, 10 Oct 2004 18:34:01 -0500 + +backupninja (0.1-1) unstable; urgency=low + + * Installing cron via dh_installcron + * Installing example backup.d configuration files via dh_installexamples + so that they end up in /usr/share/doc/backupninja/examples + * Installing logrotate config via dh_installlogrotate + * Initial Release. + + -- Micah Anderson Sun, 10 Oct 2004 15:27:39 -0500 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..317f1ef --- /dev/null +++ b/debian/control @@ -0,0 +1,28 @@ +Source: backupninja +Section: admin +Priority: optional +Maintainer: Micah Anderson +Build-Depends: debhelper (>= 4.0.0), autoconf, automake +Build-Conflicts: autoconf2.13 +Standards-Version: 3.8.0 +Homepage: http://code.autistici.org/trac/backupninja +Vcs-Svn: http://code.autistici.org/trac/backupninja/browser + +Package: backupninja +Architecture: all +Depends: gawk | mawk, dialog, bash (>=2.05b-26), mailx | mailutils +Suggests: rdiff-backup, hwinfo, genisoimage, wodim, cdrdao, dvd+rw-tools, debconf-utils, mdadm +Description: lightweight, extensible meta-backup system + Backupninja lets you drop simple config files in /etc/backup.d to + coordinate system backups. Backupninja is a master of many arts, + including incremental remote filesystem backup, MySQL backup, and ldap + backup. By creating simple drop-in handler scripts, backupninja can + learn new skills. Backupninja is a silent flower blossom death strike to + lost data. + . + In addition to backing up regular files, Backupninja has handlers to ease + backing up: ldap, maildir, MySQL, svn, trac, and the output from shell scripts + . + Backupninja currently supports common backup utilities, easing their + configuration, currently supported are: rdiff-backup, duplicity, CD/DVD + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..bf7aa96 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,33 @@ +This was turned into a debian package by Micah Anderson on +Sat, 18 Sep 2004 16:03:11 -0500. + +The upstream source was obtained from the Debian Grimoire located at +http://dev.riseup.net the subversion project is located here: +http://dev.riseup.net/websvn/listing.php?repname=backupninja&path=%2F&sc=0 +and was originally written by elijah@riseup.net, for a full list of authors +see AUTHORS. + +Copyright: + + Copyright (C) Riseup Networks + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor + Boston, MA 02110-1301, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General Public +License can be found in the /usr/share/common-licenses' directory. + diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..55bc0a6 --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +README +AUTHORS diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..7595f3c --- /dev/null +++ b/debian/rules @@ -0,0 +1,79 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +PACKAGE = backupninja +TMP = $(CURDIR)/debian/$(PACKAGE) + +INSTALL = install +INSTALL_FILE = $(INSTALL) -p -oroot -groot -m644 +INSTALL_PROGRAM = $(INSTALL) -p -oroot -groot -m755 +INSTALL_SCRIPT = $(INSTALL) -p -oroot -groot -m755 +INSTALL_DIR = $(INSTALL) -p -d -oroot -groot -m755 + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +configure: configure-stamp +configure-stamp: + dh_testdir + rm -f config.sub config.guess + ln -sf /usr/share/misc/config.sub config.sub + ln -sf /usr/share/misc/config.guess config.guess + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man + touch configure-stamp + + +build: configure-stamp build-stamp + +build-stamp: configure-stamp + dh_testdir + $(MAKE) + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) install DESTDIR=$(CURDIR)/debian/backupninja + chmod +x debian/backupninja/usr/lib/backupninja/easydialog + chmod +x debian/backupninja/usr/lib/backupninja/tools + chmod -x debian/backupninja/usr/lib/backupninja/parseini + chmod -x debian/backupninja/usr/lib/backupninja/vserver + rm debian/backupninja/usr/share/backupninja/example.* + + dh_install + +binary-arch: + +binary-indep: build-indep + +build-indep: build install + dh_testdir + dh_installdirs + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installman + dh_installexamples + dh_link + dh_compress -Xexample + dh_fixperms -Xdebian/backupninja/etc/backup.d + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/etc/Makefile.am b/etc/Makefile.am new file mode 100644 index 0000000..b713892 --- /dev/null +++ b/etc/Makefile.am @@ -0,0 +1,38 @@ + +EXTRA_DIST = backupninja.conf.in cron.d/backupninja.in \ + logrotate.d/backupninja.in + +GENERATED_FILES = backupninja.conf cron.d/backupninja logrotate.d/backupninja + +CLEANFILES = $(GENERATED_FILES) + +nobase_sysconf_DATA = $(GENERATED_FILES) + +edit = sed \ + -e "s,@BASH\@,$(BASH),g" \ + -e "s,@CFGDIR\@,$(CFGDIR),g" \ + -e "s,@sysconfdir\@,$(sysconfdir),g" \ + -e "s,@localstatedir\@,$(localstatedir),g" \ + -e "s,@pkgdatadir\@,$(pkgdatadir),g" \ + -e "s,@pkglibdir\@,$(pkglibdir),g" \ + -e "s,@sbindir\@,$(sbindir),g" \ + -e "s,@exec_prefix\@,$(exec_prefix),g" \ + -e "s,@prefix\@,$(prefix),g" + +cron.d/backupninja: cron.d/backupninja.in + rm -f cron.d/backupninja + $(edit) cron.d/backupninja.in > cron.d/backupninja + chmod 644 cron.d/backupninja + +logrotate.d/backupninja: logrotate.d/backupninja.in + rm -f logrotate.d/backupninja + $(edit) logrotate.d/backupninja.in > logrotate.d/backupninja + chmod ugo+x logrotate.d/backupninja + +backupninja.conf: backupninja.conf.in + rm -f backupninja.conf + $(edit) backupninja.conf.in > backupninja.conf + +install-data-hook: + mkdir -p $(DESTDIR)/$(sysconfdir)/backup.d + chmod 0770 $(DESTDIR)/$(sysconfdir)/backup.d diff --git a/etc/Makefile.in b/etc/Makefile.in new file mode 100644 index 0000000..c9196f9 --- /dev/null +++ b/etc/Makefile.in @@ -0,0 +1,353 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = etc +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(sysconfdir)" +nobase_sysconfDATA_INSTALL = $(install_sh_DATA) +DATA = $(nobase_sysconf_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASH = @BASH@ +CFGDIR = @CFGDIR@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +HAVE_RPM = @HAVE_RPM@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKTEMP = @MKTEMP@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_cv_have_rpm = @ac_cv_have_rpm@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = backupninja.conf.in cron.d/backupninja.in \ + logrotate.d/backupninja.in + +GENERATED_FILES = backupninja.conf cron.d/backupninja logrotate.d/backupninja +CLEANFILES = $(GENERATED_FILES) +nobase_sysconf_DATA = $(GENERATED_FILES) +edit = sed \ + -e "s,@BASH\@,$(BASH),g" \ + -e "s,@CFGDIR\@,$(CFGDIR),g" \ + -e "s,@sysconfdir\@,$(sysconfdir),g" \ + -e "s,@localstatedir\@,$(localstatedir),g" \ + -e "s,@pkgdatadir\@,$(pkgdatadir),g" \ + -e "s,@pkglibdir\@,$(pkglibdir),g" \ + -e "s,@sbindir\@,$(sbindir),g" \ + -e "s,@exec_prefix\@,$(exec_prefix),g" \ + -e "s,@prefix\@,$(prefix),g" + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu etc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-nobase_sysconfDATA: $(nobase_sysconf_DATA) + @$(NORMAL_INSTALL) + test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" + @$(am__vpath_adj_setup) \ + list='$(nobase_sysconf_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + $(am__vpath_adj) \ + echo " $(nobase_sysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconfdir)/$$f'"; \ + $(nobase_sysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconfdir)/$$f"; \ + done + +uninstall-nobase_sysconfDATA: + @$(NORMAL_UNINSTALL) + @$(am__vpath_adj_setup) \ + list='$(nobase_sysconf_DATA)'; for p in $$list; do \ + $(am__vpath_adj) \ + echo " rm -f '$(DESTDIR)$(sysconfdir)/$$f'"; \ + rm -f "$(DESTDIR)$(sysconfdir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(sysconfdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook + +install-dvi: install-dvi-am + +install-exec-am: install-nobase_sysconfDATA + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-nobase_sysconfDATA + +.MAKE: install-am install-data-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-hook install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-nobase_sysconfDATA \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-nobase_sysconfDATA + + +cron.d/backupninja: cron.d/backupninja.in + rm -f cron.d/backupninja + $(edit) cron.d/backupninja.in > cron.d/backupninja + chmod 644 cron.d/backupninja + +logrotate.d/backupninja: logrotate.d/backupninja.in + rm -f logrotate.d/backupninja + $(edit) logrotate.d/backupninja.in > logrotate.d/backupninja + chmod ugo+x logrotate.d/backupninja + +backupninja.conf: backupninja.conf.in + rm -f backupninja.conf + $(edit) backupninja.conf.in > backupninja.conf + +install-data-hook: + mkdir -p $(DESTDIR)/$(sysconfdir)/backup.d + chmod 0770 $(DESTDIR)/$(sysconfdir)/backup.d +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/etc/backupninja.conf.in b/etc/backupninja.conf.in new file mode 100644 index 0000000..f7668a5 --- /dev/null +++ b/etc/backupninja.conf.in @@ -0,0 +1,88 @@ +# +# |\_ +# B A C K U P N I N J A /()/ +# `\| +# main configuration file +# + +# how verbose to make the logs +# 5 -- Debugging messages (and below) +# 4 -- Informational messages (and below) +# 3 -- Warnings (and below) +# 2 -- Errors (and below) +# 1 -- Fatal errors (only) +loglevel = 4 + +# send a summary of the backup status to +# this email address: +reportemail = root + +# if set to 'yes', a report email will be generated +# even if all modules reported success. (default = yes) +reportsuccess = yes + +# if set to 'yes', a report email will be generated +# even if there was no error. (default = yes) +reportwarning = yes + +# if set to 'yes', disk space usage will be included in +# the backup email report +reportspace = no + +# where to rsync the backupninja.log to be aggregated in +# a ninjareport +reporthost = + +# what user to connect to reporthost to sync the +# backupninja.log +reportuser = ninja + +# where on the reporthost should the report go +# NOTE: the name of the log will be used in the report, +# use a globally unique name, preferably the hostname +reportdirectory = /var/lib/backupninja/reports + +# set to the administration group that is allowed to +# read/write configuration files in /etc/backup.d +admingroup = root + +####################################################### +# for most installations, the defaults below are good # +####################################################### + +# where to log: +logfile = @localstatedir@/log/backupninja.log + +# directory where all the backup configuration files live +configdirectory = @CFGDIR@/backup.d + +# where backupninja helper scripts are found +scriptdirectory = @pkgdatadir@ + +# where backupninja libs are found +libdirectory = @pkglibdir@ + +# whether to use colors in the log file +usecolors = yes + +# default value for 'when' +when = everyday at 01:00 + +# if running vservers, set to yes +vservers = no + +# programs paths +# SLAPCAT=/usr/sbin/slapcat +# LDAPSEARCH=/usr/bin/ldapsearch +# RDIFFBACKUP=/usr/bin/rdiff-backup +# CSTREAM=/usr/bin/cstream +# MYSQL=/usr/bin/mysql +# MYSQLHOTCOPY=/usr/bin/mysqlhotcopy +# MYSQLDUMP=/usr/bin/mysqldump +# PGSQLDUMP=/usr/bin/pg_dump +# PGSQLDUMPALL=/usr/bin/pg_dumpall +# GZIP=/bin/gzip +# RSYNC=/usr/bin/rsync +# VSERVERINFO=/usr/sbin/vserver-info +# VSERVER=/usr/sbin/vserver +# VROOTDIR=/var/lib/vservers diff --git a/etc/cron.d/backupninja.in b/etc/cron.d/backupninja.in new file mode 100644 index 0000000..5ee1b81 --- /dev/null +++ b/etc/cron.d/backupninja.in @@ -0,0 +1,6 @@ +# /etc/cron.d/backupninja -- cron tab entry for package backupninja + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +# run backupninja every hour on the hour +0 * * * * root if [ -x @sbindir@/backupninja ]; then @sbindir@/backupninja; fi diff --git a/etc/logrotate.d/backupninja.in b/etc/logrotate.d/backupninja.in new file mode 100644 index 0000000..dfb55b1 --- /dev/null +++ b/etc/logrotate.d/backupninja.in @@ -0,0 +1,6 @@ +@localstatedir@/log/backupninja.log { + rotate 6 + monthly + compress + missingok +} diff --git a/examples/Makefile.am b/examples/Makefile.am new file mode 100644 index 0000000..a2ffbb2 --- /dev/null +++ b/examples/Makefile.am @@ -0,0 +1,9 @@ + +EXAMPLES = example.dup example.ldap example.makecd example.mysql \ + example.pgsql example.rdiff example.sh example.rsync \ + example.svn example.sys example.trac example.maildir + +EXTRA_DIST = $(EXAMPLES) + +dist_pkgdata_DATA = $(EXAMPLES) + diff --git a/examples/Makefile.in b/examples/Makefile.in new file mode 100644 index 0000000..900b5ec --- /dev/null +++ b/examples/Makefile.in @@ -0,0 +1,320 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = examples +DIST_COMMON = $(dist_pkgdata_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgdatadir)" +dist_pkgdataDATA_INSTALL = $(INSTALL_DATA) +DATA = $(dist_pkgdata_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASH = @BASH@ +CFGDIR = @CFGDIR@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +HAVE_RPM = @HAVE_RPM@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKTEMP = @MKTEMP@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_cv_have_rpm = @ac_cv_have_rpm@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXAMPLES = example.dup example.ldap example.makecd example.mysql \ + example.pgsql example.rdiff example.sh example.rsync \ + example.svn example.sys example.trac example.maildir + +EXTRA_DIST = $(EXAMPLES) +dist_pkgdata_DATA = $(EXAMPLES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-dist_pkgdataDATA: $(dist_pkgdata_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" + @list='$(dist_pkgdata_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(dist_pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \ + $(dist_pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \ + done + +uninstall-dist_pkgdataDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_pkgdata_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(pkgdatadir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-dist_pkgdataDATA + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_pkgdataDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_pkgdataDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am \ + uninstall-dist_pkgdataDATA + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/examples/example.dup b/examples/example.dup new file mode 100644 index 0000000..d490f74 --- /dev/null +++ b/examples/example.dup @@ -0,0 +1,141 @@ + +# passed directly to duplicity +#options = --verbosity 8 + +# default is 0, but set to 19 if you want to lower the priority. +nicelevel = 19 + +# default is yes. set to no to skip the test if the remote host is alive +#testconnect = no + +# temporary directory used by duplicity +# (default = /tmp or /usr/tmp, depending on the system) +#tmpdir = /var/tmp/duplicity + +###################################################### +## gpg section +## (how to encrypt and optionally sign the backups) +## +## WARNING: old (pre-0.9.4) example.dup used to give wrong information about +## the way the following options are used. Please read the following +## carefully. +## +## If the encryptkey variable is set: +## - data is encrypted with the GnuPG public key specified by the encryptkey +## variable +## - if signing is enabled, data is signed with the GnuPG private +## key specified by the signkey variable +## - the password variable is used to unlock the GnuPG key(s) used +## for encryption and (optionnal) signing +## +## If the encryptkey option is not set: +## - data signing is not possible +## - the password variable is used to encrypt the data with symmetric +## encryption: no GnuPG key pair is needed + +[gpg] + +# when set to yes, encryptkey variable must be set below; if you want to use +# two different keys for encryption and signing, you must also set the signkey +# variable below. +# default is no, for backwards compatibility with backupninja <= 0.5. +sign = yes + +# ID of the GnuPG public key used for data encryption. +# if not set, symmetric encryption is used, and data signing is not possible. +encryptkey = 04D9EA79 + +# ID of the GnuPG private key used for data signing. +# if not set, encryptkey will be used. +#signkey = 04D9EA79 + +# password +# NB: neither quote this, nor should it contain any quotes +password = a_very_complicated_passphrase + +###################################################### +## source section +## (where the files to be backed up are coming from) + +[source] + +# A few notes about includes and excludes: +# 1. include, exclude and vsinclude statements support globbing with '*' +# 2. Symlinks are not dereferenced. Moreover, an include line whose path +# contains, at any level, a symlink to a directory, will only have the +# symlink backed-up, not the target directory's content. Yes, you have to +# dereference yourself the symlinks, or to use 'mount --bind' instead. +# Example: let's say /home is a symlink to /mnt/crypt/home ; the following +# line will only backup a "/home" symlink ; neither /home/user nor +# /home/user/Mail will be backed-up : +# include = /home/user/Mail +# A workaround is to 'mount --bind /mnt/crypt/home /home' ; another one is to +# write : +# include = /mnt/crypt/home/user/Mail +# 3. All the excludes come after all the includes. The order is not otherwise +# taken into account. + +# files to include in the backup +include = /var/spool/cron/crontabs +include = /var/backups +include = /etc +include = /root +include = /home +include = /usr/local/bin +include = /usr/local/sbin +include = /var/lib/dpkg/status +include = /var/lib/dpkg/status-old + +# If vservers = yes in /etc/backupninja.conf then the following variables can +# be used: +# vsnames = all | ... (default = all) +# vsinclude = +# vsinclude = +# ... +# Any path specified in vsinclude is added to the include list for each vserver +# listed in vsnames (or all if vsnames = all, which is the default). +# +# For example, vsinclude = /home will backup the /home directory in every +# vserver listed in vsnames. If you have 'vsnames = foo bar baz', this +# vsinclude will add to the include list /vservers/foo/home, /vservers/bar/home +# and /vservers/baz/home. +# Vservers paths are derived from $VROOTDIR. + +# files to exclude from the backup +exclude = /home/*/.gnupg + +###################################################### +## destination section +## (where the files are copied to) + +[dest] + +# perform an incremental backup? (default = yes) +# if incremental = no, perform a full backup in order to start a new backup set +#incremental = yes + +# how many days of data to keep ; default is 60 days. +# (you can also use the time format of duplicity) +# 'keep = yes' means : do not delete old data, the remote host will take care of this +#keep = 60 +#keep = yes + +# bandwith limit, in kbit/s ; default is 0, i.e. no limit +#bandwidthlimit = 128 + +# passed directly to ssh, scp (and sftp in duplicity >=0.4.2) +# warning: sftp does not support all scp options, especially -i; as +# a workaround, you can use "-o " +sshoptions = -o IdentityFile=/root/.ssh/id_dsa_duplicity + +# put the backups under this directory +destdir = /backups + +# the machine which will receive the backups +desthost = backuphost + +# make the files owned by this user +# note: you must be able to ssh backupuser@backhost +# without specifying a password (if type = remote). +destuser = backupuser + diff --git a/examples/example.ldap b/examples/example.ldap new file mode 100644 index 0000000..adc1fcd --- /dev/null +++ b/examples/example.ldap @@ -0,0 +1,45 @@ +## +## configuration file for openldap backups +## +## If the method is set to "slapcat", the LDIFs generated are +## suitable for use with slapadd. As the entries are in database +## order, not superior first order, they cannot be loaded with +## ldapadd without being reordered. +## + +## backupdir (default /var/backups/ldap): the destination for the backups +# backupdir = /var/backups/ldap + +## conf (default /etc/ldap/slapd.conf): the location of the slapd.conf file. +# conf = /etc/ldap/slapd.conf + +## databases (default all): either a space separated list of database +## numbers or prefixes, or the keyword 'all'. +# databases = all + +## compress (default yes): if set to yes, ldif exports are gzipped. +# compress = yes + +## restart (default no): if set to yes, slapd is stopped before backups are +## performed, and then started again after they have finished, this is necessary +## if your backend is ldbm and your method is slapcat, but unnecessary otherwise. +# restart = no + +## method (default ldapsearch): either 'ldapsearch' or 'slapcat' +## ldapsearch is the safer method to do backups, but is slow, slapcat +## is much faster, but should not be done on an ldbm backend unless you have +## restart set to yes +## NOTE: with the ldapsearch method passwordfile and binddn need to be set +# method = ldapsearch + +## passwordfile (no default): this should be set to the file that contains +## your ldap password, this is required for ldapsearch and not needed for slapcat +## this file should have no newlines in it, echo -n "password" > passfile works. +## NOTE: be sure to set the permissions on your password file appropriately +## (hint: world readable is not appropriate) +# passwordfile = + +## binddn (no default): set this to the DN of the user that the ldapsearch binds +## to, not needed for slapcat +# binddn = + diff --git a/examples/example.maildir b/examples/example.maildir new file mode 100644 index 0000000..8898a78 --- /dev/null +++ b/examples/example.maildir @@ -0,0 +1,58 @@ +## +## This is an example maildir configuration file. +## +## The maildir handler slowly creates a backup of each user's +## maildir to a remote server. It is designed to be run with +## low overhead in terms of CPU and bandwidth, so it runs pretty +## slow. Hardlinking is used to save storage space. The actual +## maildir is stored within each snapshot directory. +## +## The basic algorithm is to rsync each maildir individually, +## and to use hard links for retaining historical data. +## +## We handle each maildir individually because it becomes very +## unweldy to hardlink and rsync many hundreds of thousands +## of files at once. It is much faster to take on smaller +## chunks at a time. +## +## Any maildir which is deleted from the source will be moved to +## "deleted" directory in the destination. It is up to you to +## periodically remove this directory or old maildirs in it. +## +## Note: This handler assumes that the remote shell is set to bash +## +## The defaults are useful in most cases, just make sure +## to configure the source and destination information + +when = everyday at 21:00 + +## each users maildir will contain these files: +## daily.1, daily.2, daily.3, daily.4, daily.5, weekly.1, weekly.2, +## weekly.3, monthly.1 +## if keepdaily is 5, keepweekly is 3, and keepmonthly is 1 +keepdaily = 5 +keepweekly = 3 +keepmonthly = 1 + +# directory which contains all the maildirs +srcdir = /maildir/riseup.net + +# the srcdir is expected to contain the following subdirectories. Each +# of these will contain the user's Maildirs which start with these +# letters +srcsubdirs = 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z + +# put the backups under this directory +destdir = /crypta/maildir/riseup.net +desthost = kakapo-pn + +# For the backup rotation to work, destuser must be able to run +# arbitrary bash commands on the desthost. +destuser = backer + +# remove any maildirs from backup which might have been deleted +remove = yes + +# use a ssh-mux to reuse connections, see the following article +# http://www.debian-administration.org/articles/290 for an example +multiconnection = notset diff --git a/examples/example.makecd b/examples/example.makecd new file mode 100644 index 0000000..b01094e --- /dev/null +++ b/examples/example.makecd @@ -0,0 +1,31 @@ + +# TYP is cd or dvd AS WELL AS the disk inside!! +burnertype = cd + +# system (yes) or directory/files (no) +# this function not yet implemented +#system = yes + +# location for image file +backupdir = /var/backups/makecd + +# image filename +imagefile = example.iso + +# iso or burn to cd/dvd? +isoonly = no + +# cd/dvd burner device +device=/dev/hdc + +# base directory to include in the backup +target = / + +# files or directories to be excluded +exclude = /proc +exclude = /lost+found +exclude = /tmp + +# backupninja will perfrom this at gvien date/time +when = wednesday at 02:00 + diff --git a/examples/example.mysql b/examples/example.mysql new file mode 100644 index 0000000..bd996e7 --- /dev/null +++ b/examples/example.mysql @@ -0,0 +1,85 @@ +### backupninja mysql config file ### + +databases = all +backupdir = /var/backups/mysql +hotcopy = no +sqldump = yes +compress = yes + +### authentication ### + +# three authentication methods: +# +# 1. setting the user, so that /home/user/.my.cnf is used. +# user = some-unix-user +# +# 2. specifying the mysql dbuser and dbpassword, +# which generates a temporary .my.cnf in /root/.my.cnf +# dbusername = +# dbpassword = +# +# 3. specify which config file to use with configfile +# (this option does not work with hotcopy) +# configfile = /etc/mysql/debian.cnf +# +# if user and dbusername are not specified, the default is to use +# /etc/mysql/debian.cnf for configfile. + +### all options ### + +# configfile = < path/to/file > (default = /etc/mysql/debian.cnf) +# The config file is passed to mysql with --defaults-file. +# On debian, this default will allow backupninja to make backups +# of mysql without configuring any additional options. +# (this option is not compatible with "user" or "dbusername"). +# +# user = (default = root) +# Run mysql commands as 'user'. A valid .my.cnf must exist with a +# database username and password in the user's home directory. +# (this option is not compatible with "configfile" or "dbusername"). +# +# dbusername = (no default) +# The user must have access to the databases specified later. +# (this option is not compatible with "configfile" or "user"). +# +# dbpassword = (no default) +# The password used with dbusername. this password will NOT be passed +# on the command line and is not readable using "ps aux". +# +# dbhost = (default = localhost) +# only localhost works right now. +# +# databases = < all | db1 db2 db3 > (default = all) +# which databases to backup. should either be the word 'all' or a +# space separated list of database names. +# +# nodata = < db.table1 db.table2 db.table3 > (no default) +# only dump the structure for the database tables listed here, this means +# no data contained in these tables will be dumped. This is very useful +# to backup databases that have tables with large amounts of cache data that +# isn't necessary to backup, but you still need the structure to exist +# on a restore. You *must* specify the table as part of a database, such +# as "drupal.cache", where the database name is "drupal" and the table that +# you do not want to dump the data for is called "cache". +# +# backupdir = < path/to/destination > (default = /var/backups/mysql) +# where to dump the backups. hotcopy backups will be in a subdirectory +# 'hotcopy' and sqldump backups will be in a subdirectory 'sqldump' +# +# hotcopy = < yes | no > (default = no) +# make a backup of the actual database binary files using mysqlhotcopy. +# +# sqldump = < yes | no > (default = no) +# make a backup using mysqldump. this creates text files with sql commands +# sufficient to recontruct the database. +# +# compress = < yes | no > (default = yes) +# if yes, compress the sqldump output. +# +# vsname = (no default) +# what vserver to operate on (only used if vserver = yes +# in /etc/backupninja.conf), if you do not specify a vsname the +# host will be operated on +# +# NB: databases = all doesn't seem to work with hotcopy = yes +# when vsname is specified, I would like to know how to fix this. diff --git a/examples/example.pgsql b/examples/example.pgsql new file mode 100644 index 0000000..42f045e --- /dev/null +++ b/examples/example.pgsql @@ -0,0 +1,23 @@ +### backupninja PostgreSQL config file ### + +# vsname = (no default) +# what vserver to operate on, only used if vserver = yes in /etc/backupninja.conf +# if you do not specify a vsname the host will be operated on +# Note: if operating on a vserver, $VROOTDIR will be prepended to backupdir. + +# backupdir = (default: /var/backups/postgres) +# where to dump the backups + +# databases = < all | db1 db2 db3 > (default = all) +# which databases to backup. should either be the word 'all' or a +# space separated list of database names. +# Note: when using 'all', pg_dumpall is used instead of pg_dump, which means +# that cluster-wide data (such as users and groups) are saved. + +# compress = < yes | no > (default = yes) +# if yes, compress the pg_dump/pg_dumpall output. + +### You can also set the following variables in /etc/backupninja.conf: +# PGSQLDUMP: pg_dump path (default: /usr/bin/pg_dump) +# PGSQLDUMPALL: pg_dumpall path (default: /usr/bin/pg_dumpall) +# PGSQLUSER: user running PostgreSQL (default: postgres) diff --git a/examples/example.rdiff b/examples/example.rdiff new file mode 100644 index 0000000..3767f9b --- /dev/null +++ b/examples/example.rdiff @@ -0,0 +1,120 @@ +## +## This is an example rdiff-backup configuration file. +## The defaults are useful in most cases, just make sure +## to configure the destination host and user. +## + +## passed directly to rdiff-backup +# options = --force + +## default is 0, but set to 19 if you want to lower the priority. +# nicelevel = 19 + +## default is yes. set to no to skip the test if the remote host is alive +# testconnect = no + +## default is not to limit bandwidth. +## set to a number in bytes/second to limit bandwidth usage. Use a negative +## number to set a limit that will never be exceeded, or a positive number +## to set a target average bandwidth use. cstream is required. See cstream's +## -t option for more information. 62500 bytes = 500 Kb (.5 Mb) +# bwlimit = 62500 + +## should backupninja ignore the version differences between source and remote +## rdiff-backup? (default: no) +## This could be useful if the version differences between rdiff-backup instances +## on remote and local side are different, and you are certain there are no +## problems in using mis-matched versions and want to get beyond this check. +## An example usage could be the remote side has its authorized_keys configured +## with command="rdiff-backup --server" to allow for restricted yet automated +## password-less backups +# ignore_version = no + +###################################################### +## source section +## (where the files to be backed up are coming from) + +[source] + +# an optional subdirectory below 'directory' (see [dest]) +label = thishostname + +# type can be "local" or "remote" +type = local + +# only use if '[source] type = remote' +#host = srchost +#user = srcuser + +# how many days of data to keep +# (you can also use the time format of rdiff-backup, e.g. 6D5h) +# (to keep everything, set this to yes) +#keep = yes +keep = 60 + +# A few notes about includes and excludes: +# 1. include, exclude and vsinclude statements support globbing with '*' +# 2. Symlinks are not dereferenced. Moreover, an include line whose path +# contains, at any level, a symlink to a directory, will only have the +# symlink backed-up, not the target directory's content. Yes, you have to +# dereference yourself the symlinks, or to use 'mount --bind' instead. +# Example: let's say /home is a symlink to /mnt/crypt/home ; the following +# line will only backup a "/home" symlink ; neither /home/user nor +# /home/user/Mail will be backed-up : +# include = /home/user/Mail +# A workaround is to 'mount --bind /mnt/crypt/home /home' ; another one is to +# write : +# include = /mnt/crypt/home/user/Mail +# 3. All the excludes come after all the includes. The order is not otherwise +# taken into account. + +# files to include in the backup +include = /var/spool/cron/crontabs +include = /var/backups +include = /etc +include = /root +include = /home +include = /usr/local/bin +include = /usr/local/sbin +include = /var/lib/dpkg/status +include = /var/lib/dpkg/status-old + +# If vservers = yes in /etc/backupninja.conf then the following variables can +# be used: +# vsnames = all | ... (default = all) +# vsinclude = +# vsinclude = +# ... +# Any path specified in vsinclude is added to the include list for each vserver +# listed in vsnames (or all if vsnames = all, which is the default). +# +# For example, vsinclude = /home will backup the /home directory in every +# vserver listed in vsnames. If you have 'vsnames = foo bar baz', this +# vsinclude will add to the include list /vservers/foo/home, /vservers/bar/home +# and /vservers/baz/home. +# Vservers paths are derived from $VROOTDIR. + +# files to exclude from the backup +#exclude = /home/*/.gnupg + +###################################################### +## destination section +## (where the files are copied to) + +[dest] + +# type can be "local" or "remote" +type = remote + +# put the backups under this directory +directory = /backups + +# the machine which will receive the backups. +# only use if "[dest] type = remote" +host = backuphost + +# make the files owned by this user. you must be able to +# `su -c "ssh backupuser@backhost"` without specifying a password. +# only use if "[dest] type = remote" +user = backupuser + diff --git a/examples/example.rsync b/examples/example.rsync new file mode 100644 index 0000000..9053f3e --- /dev/null +++ b/examples/example.rsync @@ -0,0 +1,127 @@ +# +# rsync handler example file +# +# Mandatory options are uncommented with sugested values +# Other options are commented out with their default values +# +# Note: You dont need to manually specify vservers using "include = /vservers". +# They're automatically backuped if vserver is set to "yes" on you backupninja.conf. + +[general] + +# rsync log file +#log = /var/log/backup/rsync.log + +# partition device where the backup lives +# just use this option if your data is backed up in a separate partition and +# you want backupninja to fsck it; this option will just be used if fscheck +# (see below) is set to 'yes' +#partition = + +# backup partition mountpoint or backup main folder +# this doesn't need to be a real partition, but should be at least the +# main folder where the backup is being stored +mountpoint = /mnt/backup + +# folder relative do mountpoint where the backup should be stored +backupdir = myserver + +# number of backup increments (min = 5) +days = 7 + +# set to 1 if fsck should run on partition after the backup is made +#fscheck = + +# set to 1 if $partition is mounted read-only +#read_only = + +# use this if you need a lockfile to be kept during backup execution +# this is an useful feature in case you have some tasks that should +# know if the backup is running or not +#lockfile = + +# rsync command nice level +#nicelevel = 0 + +# set to "yes" if your system isnt handling timestamps correctly +#enable_mv_timestamp_bug = no + +# temp folder +#tmp = /tmp + +[source] + +# where the data to be backed up is (local or remote) +#from = local + +# if remote source, specify the hostname or IP +#host = + +# when "yes", test the connection for a remote source before backup +#testconnect = no + +# include folder on backup +include = /etc +include = /var + +# exclude folder on backup +exclude = exclude_folder1 +exclude = exclude_folder2 + +# exlude some vserver from backup +# this is used only if vservers = yes on backupninja.conf +exclude_vserver = excluded_vserver1 +exclude_vserver = excluded_vserver2 + +# ssh command line (remote only) +#ssh = ssh + +# rsync program +# it defaults to $RSYNC value from backupninja.conf +#rsync = $RSYNC + +# rsync command options +#rsync_options = "-av --delete" + +# when set to 1, use numeric ids instead of user/group mappings on rsync +#numericids = 0 + +# if set to 1, compress data on rsync (remote source only) +#compress = 0 + +# set a badnwidth limit in kbps (remote source only) +#bandwidthlimit = + +# remote rsync program (remote source only) +#remote_rsync = rsync + +# This section is used to stop and start services that should be turned of +# during the backup procedure. +# +#[services] +# +# absolute path where scripts are located +#initscripts = +# +# script name to be stoped at the begining of the backup and started at its end +#service = + +# You can also specify some system comands if you don't want the default system values +# by enabling the section below. +# +#[system] +# +# rm command +#rm = rm +# +# cp command +#cp = cp +# +# touch command +#touch = touch +# +# mv command +#mv = mv +# +# fsck command +#fsck = fsck diff --git a/examples/example.sh b/examples/example.sh new file mode 100644 index 0000000..f02f026 --- /dev/null +++ b/examples/example.sh @@ -0,0 +1,2 @@ + +dpkg --get-selections > /var/backups/dpkg-selections.txt diff --git a/examples/example.svn b/examples/example.svn new file mode 100644 index 0000000..ea43601 --- /dev/null +++ b/examples/example.svn @@ -0,0 +1,26 @@ +## +## Perform a hot backup of subversion repositories. +## +## REQUIRES: apt-get install subversion-tools +## +## This file can be empty, the defaults are usually good. +## + +## where subversion data lives +# src = /var/lib/svn + +## where to save the backups to +# dest = /var/backups/svn + +## where to save temporary backups +## (if successful, $tmp is moved to $dest) +# tmp = /var/backups/svn.tmp + +## the hotbackup program to use. +## svnadmin hotcopy now exists, the following script is located +## in /usr/share/doc/subversion/examples now if you wish to use +## it instead +# HOTBACKUP = /usr/lib/subversion/hot-backup.py + +## the name of the vserver containing svn, if using vservers +# vsname = diff --git a/examples/example.sys b/examples/example.sys new file mode 100644 index 0000000..af28fd6 --- /dev/null +++ b/examples/example.sys @@ -0,0 +1,52 @@ +# +# this config file will save various reports of vital system information. +# by default, all the reports are enabled and are saved in /var/backups. +# +# requires dpkg, debconf-utils, sfdisk, and hwinfo +# +# (1) a capture of the debconf package selection states. This file +# can be used to restore the answers to debconf questions for +# packages that you will be installing through (2) below. To +# do this, run: "debconf-set-selections < debconfsel.txt" +# +# (2) a list of all the packages installed and removed. +# this file can be used to restore the state of installed packages +# by running "dpkg --set-selections < dpkg-selections.txt and +# then run "apt-get -u dselect-upgrade". If you have the +# debconf-set-selections file from (1), you should restore those first. +# +# (3) the partition table of all disks. +# this partition table can be used to format another disk of +# the same size. this can be handy if using software raid and +# you have a disk go bad. just replace the disk and partition it +# by running "sfdisk /dev/sdb < partitions.sdb.txt" +# (MAKE SURE YOU PARTITION THE CORRECT DISK!!!) +# +# (4) hardware information. +# detailed information on most important aspects of the hardware. +# + +# here are the defaults, commented out: + +# The output from the sys handler will be placed in $parentdir +# parentdir = /var/backups +# packages = yes +# packagesfile = /var/backups/dpkg-selections.txt +# selectionsfile = /var/backups/debconfsel.txt + +# partitions = yes +# NOTE: the __star__ below will be replaced by the disks found on the +# system (e.g. partitions.sda.txt, partitions.sdb.txt). If you change +# the partitionsfile default below, be sure to include the __star__ +# replacement in the filename, or you will get one file for only one disk, +# the others being written to the same file, and then overwritten by the next. +# partitionsfile = /var/backups/partitions.__star__.txt +# dosfdisk = yes + +# hardware = yes +# hardwarefile = /var/backups/hardware.txt +# dohwinfo = yes + +# If vservers = yes in /etc/backupninja.conf then the following variables can +# be used: +# vsnames = all | ... (default = all) diff --git a/examples/example.trac b/examples/example.trac new file mode 100644 index 0000000..645998e --- /dev/null +++ b/examples/example.trac @@ -0,0 +1,16 @@ +## +## Perform backups of trac environment +## +## REQUIRES: apt-get install trac +## +## This file can be empty, the defaults are usually good. +## + +## where one or more Trac environments live +src = /var/lib/trac + +## where to save the backups to +dest = /var/backups/trac + +## where to save temporary backups +tmp = /var/backups/trac.tmp diff --git a/handlers/Makefile.am b/handlers/Makefile.am new file mode 100644 index 0000000..eaf4b9e --- /dev/null +++ b/handlers/Makefile.am @@ -0,0 +1,92 @@ + +HANDLERS = dup dup.helper ldap ldap.helper maildir makecd \ + makecd.helper mysql mysql.helper pgsql pgsql.helper rdiff \ + rdiff.helper rsync sh svn sys sys.helper trac + +CLEANFILES = $(HANDLERS) + +EXTRA_DIST = Makefile.am $(HANDLERS) + +edit = sed \ + -e "s,@BASH\@,$(BASH),g" \ + -e "s,@AWK\@,$(AWK),g" \ + -e "s,@SED\@,$(SED),g" + +dist_pkgdata_DATA = $(HANDLERS) + +dup: $(srcdir)/dup.in + rm -f dup + $(edit) $(srcdir)/dup.in > dup + +dup.helper: $(srcdir)/dup.helper.in + rm -f dup.helper + $(edit) $(srcdir)/dup.helper.in > dup.helper + +ldap: $(srcdir)/ldap.in + rm -f ldap + $(edit) $(srcdir)/ldap.in > ldap + +ldap.helper: $(srcdir)/ldap.helper.in + rm -f ldap.helper + $(edit) $(srcdir)/ldap.helper.in > ldap.helper + +maildir: $(srcdir)/maildir.in + rm -f maildir + $(edit) $(srcdir)/maildir.in > maildir + +makecd: $(srcdir)/makecd.in + rm -f makecd + $(edit) $(srcdir)/makecd.in > makecd + +makecd.helper: $(srcdir)/makecd.helper.in + rm -f makecd.helper + $(edit) $(srcdir)/makecd.helper.in > makecd.helper + +mysql: $(srcdir)/mysql.in + rm -f mysql + $(edit) $(srcdir)/mysql.in > mysql + +mysql.helper: $(srcdir)/mysql.helper.in + rm -f mysql.helper + $(edit) $(srcdir)/mysql.helper.in > mysql.helper + +pgsql: $(srcdir)/pgsql.in + rm -f pgsql + $(edit) $(srcdir)/pgsql.in > pgsql + +pgsql.helper: $(srcdir)/pgsql.helper.in + rm -f pgsql.helper + $(edit) $(srcdir)/pgsql.helper.in > pgsql.helper + +rdiff: $(srcdir)/rdiff.in + rm -f rdiff + $(edit) $(srcdir)/rdiff.in > rdiff + +rdiff.helper: $(srcdir)/rdiff.helper.in + rm -f rdiff.helper + $(edit) $(srcdir)/rdiff.helper.in > rdiff.helper + +rsync: $(srcdir)/rsync.in + rm -f rsync + $(edit) $(srcdir)/rsync.in > rsync + +sh: $(srcdir)/sh.in + rm -f sh + $(edit) $(srcdir)/sh.in > sh + +svn: $(srcdir)/svn.in + rm -f svn + $(edit) $(srcdir)/svn.in > svn + +sys: $(srcdir)/sys.in + rm -f sys + $(edit) $(srcdir)/sys.in > sys + +sys.helper: $(srcdir)/sys.helper.in + rm -f sys.helper + $(edit) $(srcdir)/sys.helper.in > sys.helper + +trac: $(srcdir)/trac.in + rm -f trac + $(edit) $(srcdir)/trac.in > trac + diff --git a/handlers/Makefile.in b/handlers/Makefile.in new file mode 100644 index 0000000..4a4d16a --- /dev/null +++ b/handlers/Makefile.in @@ -0,0 +1,403 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = handlers +DIST_COMMON = $(dist_pkgdata_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgdatadir)" +dist_pkgdataDATA_INSTALL = $(INSTALL_DATA) +DATA = $(dist_pkgdata_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASH = @BASH@ +CFGDIR = @CFGDIR@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +HAVE_RPM = @HAVE_RPM@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKTEMP = @MKTEMP@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_cv_have_rpm = @ac_cv_have_rpm@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +HANDLERS = dup dup.helper ldap ldap.helper maildir makecd \ + makecd.helper mysql mysql.helper pgsql pgsql.helper rdiff \ + rdiff.helper rsync sh svn sys sys.helper trac + +CLEANFILES = $(HANDLERS) +EXTRA_DIST = Makefile.am $(HANDLERS) +edit = sed \ + -e "s,@BASH\@,$(BASH),g" \ + -e "s,@AWK\@,$(AWK),g" \ + -e "s,@SED\@,$(SED),g" + +dist_pkgdata_DATA = $(HANDLERS) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu handlers/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu handlers/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-dist_pkgdataDATA: $(dist_pkgdata_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" + @list='$(dist_pkgdata_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(dist_pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \ + $(dist_pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \ + done + +uninstall-dist_pkgdataDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_pkgdata_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(pkgdatadir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-dist_pkgdataDATA + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_pkgdataDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_pkgdataDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am \ + uninstall-dist_pkgdataDATA + + +dup: $(srcdir)/dup.in + rm -f dup + $(edit) $(srcdir)/dup.in > dup + +dup.helper: $(srcdir)/dup.helper.in + rm -f dup.helper + $(edit) $(srcdir)/dup.helper.in > dup.helper + +ldap: $(srcdir)/ldap.in + rm -f ldap + $(edit) $(srcdir)/ldap.in > ldap + +ldap.helper: $(srcdir)/ldap.helper.in + rm -f ldap.helper + $(edit) $(srcdir)/ldap.helper.in > ldap.helper + +maildir: $(srcdir)/maildir.in + rm -f maildir + $(edit) $(srcdir)/maildir.in > maildir + +makecd: $(srcdir)/makecd.in + rm -f makecd + $(edit) $(srcdir)/makecd.in > makecd + +makecd.helper: $(srcdir)/makecd.helper.in + rm -f makecd.helper + $(edit) $(srcdir)/makecd.helper.in > makecd.helper + +mysql: $(srcdir)/mysql.in + rm -f mysql + $(edit) $(srcdir)/mysql.in > mysql + +mysql.helper: $(srcdir)/mysql.helper.in + rm -f mysql.helper + $(edit) $(srcdir)/mysql.helper.in > mysql.helper + +pgsql: $(srcdir)/pgsql.in + rm -f pgsql + $(edit) $(srcdir)/pgsql.in > pgsql + +pgsql.helper: $(srcdir)/pgsql.helper.in + rm -f pgsql.helper + $(edit) $(srcdir)/pgsql.helper.in > pgsql.helper + +rdiff: $(srcdir)/rdiff.in + rm -f rdiff + $(edit) $(srcdir)/rdiff.in > rdiff + +rdiff.helper: $(srcdir)/rdiff.helper.in + rm -f rdiff.helper + $(edit) $(srcdir)/rdiff.helper.in > rdiff.helper + +rsync: $(srcdir)/rsync.in + rm -f rsync + $(edit) $(srcdir)/rsync.in > rsync + +sh: $(srcdir)/sh.in + rm -f sh + $(edit) $(srcdir)/sh.in > sh + +svn: $(srcdir)/svn.in + rm -f svn + $(edit) $(srcdir)/svn.in > svn + +sys: $(srcdir)/sys.in + rm -f sys + $(edit) $(srcdir)/sys.in > sys + +sys.helper: $(srcdir)/sys.helper.in + rm -f sys.helper + $(edit) $(srcdir)/sys.helper.in > sys.helper + +trac: $(srcdir)/trac.in + rm -f trac + $(edit) $(srcdir)/trac.in > trac +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/handlers/dup.helper.in b/handlers/dup.helper.in new file mode 100644 index 0000000..c1fbdd5 --- /dev/null +++ b/handlers/dup.helper.in @@ -0,0 +1,514 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- + +HELPERS="$HELPERS dup:incremental_encrypted_remote_filesystem_backup" + +### Functions + +do_dup_host_includes() { + set -o noglob + # choose the files to backup + REPLY= + while [ -z "$REPLY" ]; do + formBegin "$dup_title - host system: includes" + [ -z "$dup_includes" ] && dup_includes="$dup_default_includes" + for i in $dup_includes; do + formItem include "$i" + done + formItem include "" + formItem include "" + formItem include "" + formDisplay + [ $? = 0 ] || return 1 + dup_includes="$REPLY" + done + set +o noglob +} + +do_dup_vserver() { + # choose the vservers to backup (into $selected_vservers) + choose_one_or_more_vservers "$dup_title" + [ $? = 0 ] || return 1 + + set -o noglob + # choose the files to backup + REPLY= + while [ -z "$REPLY" ]; do + formBegin "$dup_title - vservers: vsincludes (backup these directories from every selected vserver)" + [ -z "$dup_vsincludes" ] && dup_vsincludes="$dup_default_includes" + for i in $dup_vsincludes; do + formItem include "$i" + done + formItem include "" + formItem include "" + formItem include "" + formDisplay + [ $? = 0 ] || return 1 + dup_vsincludes="$REPLY" + done + set +o noglob +} + +do_dup_excludes() { + set -o noglob + formBegin "$dup_title: excludes" + [ -z "$dup_excludes" ] && dup_excludes="$dup_default_excludes" + for i in $dup_excludes; do + formItem exclude "$i" + done + formItem exclude "" + formItem exclude "" + formItem exclude "" + formDisplay + [ $? = 0 ] || return 1 + dup_excludes="$REPLY" + set +o noglob +} + +do_dup_src() { + choose_host_or_vservers_or_both "$dup_title" + [ $? = 0 ] || return 1 + case $host_or_vservers in + 'host') + do_dup_host_includes + [ $? = 0 ] || return 1 + ;; + 'vservers') + do_dup_vserver + [ $? = 0 ] || return 1 + ;; + 'both') + do_dup_host_includes + [ $? = 0 ] || return 1 + do_dup_vserver + [ $? = 0 ] || return 1 + ;; + *) + return 1 + ;; + esac + do_dup_excludes + [ $? = 0 ] || return 1 + + _src_done="(DONE)" + setDefault dest +} + +do_dup_dest() { + + local replyconverted + local thereply + + set -o noglob + REPLY= + while [ -z "$REPLY" -o -z "$dup_destdir" -o -z "$dup_desthost" -o -z "$dup_destuser" ]; do + formBegin "$dup_title - destination: first three items are compulsory" + formItem "desthost" "$dup_desthost" + formItem "destuser" "$dup_destuser" + formItem "destdir" "$dup_destdir" + formItem "keep" "$dup_keep" + formItem "incremental" "$dup_incremental" + formItem "bandwidthlimit" "$dup_bandwidth" + formItem "sshoptions" "$dup_sshoptions" + formDisplay + [ $? = 0 ] || return 1 + + IFS=$'' + replyconverted=`echo $REPLY | tr '\n' :` + IFS=$':' + thereply=($replyconverted) + IFS=$' \t\n' + + dup_desthost=${thereply[0]} + dup_destuser=${thereply[1]} + dup_destdir=${thereply[2]} + dup_keep=${thereply[3]} + dup_incremental=${thereply[4]} + dup_bandwidth=${thereply[5]} + dup_sshoptions=${thereply[6]} + + done + set +o noglob + + _dest_done="(DONE)" + setDefault gpg +} + +do_dup_gpg_encryptkey() { + REPLY= + while [ -z "$REPLY" -o -z "$dup_gpg_encryptkey" ]; do + inputBox "$dup_title - GnuPG" "Enter ID of the public GnuPG key to be used to encrypt the backups:" "$dup_gpg_encryptkey" + [ $? = 0 ] || return 1 + dup_gpg_encryptkey="$REPLY" + done +} + +do_dup_gpg_sign() { + # sign ? + booleanBox "$dup_title - GnuPG" "Sign the backups?" "$dup_gpg_sign" + if [ $? = 0 ]; then + dup_gpg_sign=yes + else + dup_gpg_sign=no + fi +} + +do_dup_gpg_signkey() { + # one key pair ? + booleanBox "$dup_title - GnuPG" "Use the same GnuPG key pair for encryption and signing?" "$dup_gpg_onekeypair" + if [ $? = 0 ]; then + dup_gpg_onekeypair=yes + else + dup_gpg_onekeypair=no + fi + + if [ "$dup_gpg_onekeypair" == "no" }; then + # signkey ? + REPLY= + while [ -z "$REPLY" -o -z "$dup_gpg_signkey" ]; do + inputBox "$dup_title - GnuPG" "Enter the ID of the private GnuPG key to be used to sign the backups:" "$dup_gpg_signkey" + [ $? = 0 ] || return 1 + dup_gpg_signkey="$REPLY" + done + fi +} + +do_dup_gpg_passphrase() { + local question="Enter the passphrase needed to unlock the GnuPG key:" + REPLY= + while [ -z "$REPLY" -o -z "$dup_gpg_password" ]; do + passwordBox "$dup_title - GnuPG" "$question" + [ $? = 0 ] || return 1 + dup_gpg_password="$REPLY" + done +} + +do_dup_gpg() { + + # symmetric or public key encryption ? + booleanBox "$dup_title - GnuPG" "Use public key encryption? Otherwise, symmetric encryption will be used, and data signing will be impossible." "$dup_gpg_asymmetric_encryption" + if [ $? = 0 ]; then + dup_gpg_asymmetric_encryption=yes + else + dup_gpg_asymmetric_encryption=no + fi + + # when using public/private key pair encryption, ask for the keys to use + if [ "$dup_gpg_asymmetric_encryption" == yes ]; then + do_dup_gpg_encryptkey ; [ $? = 0 ] || return 1 + do_dup_gpg_sign ; [ $? = 0 ] || return 1 + if [ "$dup_gpg_sign" == yes ]; then + do_dup_gpg_signkey ; [ $? = 0 ] || return 1 + fi + else + dup_gpg_sign=no + fi + + # a passphrase is alway needed + do_dup_gpg_passphrase + + _gpg_done="(DONE)" + setDefault adv + # TODO: replace the above line by the following when do_dup_conn is written + # setDefault conn +} + +# TODO: share rdiff.helper code in some lib, and use it here +do_dup_conn() { + _con_done="(DONE)" + setDefault adv +} + +do_dup_misc_options() { + + set -o noglob + local replyconverted + local thereply + + formBegin "$dup_title - misc. options" + formItem "nicelevel" "$dup_nicelevel" + formItem "testconnect" "$dup_testconnect" + formItem "options" "$dup_options" + formDisplay + [ $? = 0 ] || return 1 + + IFS=$'' + replyconverted=`echo $REPLY | tr '\n' :` + IFS=$':' + thereply=($replyconverted) + IFS=$' \t\n' + + dup_nicelevel=${thereply[0]} + dup_testconnect=${thereply[1]} + dup_options=${thereply[2]} + + set +o noglob +} + +# (rdiff.helper compatible interface... there could be some sode to share, hmmm.) +do_dup_adv() { + do_dup_misc_options + [ $? = 0 ] || return 1 + _adv_done="(DONE)" + setDefault finish +} + +do_dup_finish() { + get_next_filename $configdirectory/90.dup + cat > $next_filename <> $next_filename + done + set +o noglob + fi + + cat >> $next_filename < ... (default = all) +# vsinclude = +# vsinclude = +# ... +# Any path specified in vsinclude is added to the include list for each vserver +# listed in vsnames (or all if vsnames = all, which is the default). +# +# For example, vsinclude = /home will backup the /home directory in every +# vserver listed in vsnames. If you have 'vsnames = foo bar baz', this +# vsinclude will add to the include list /vservers/foo/home, /vservers/bar/home +# and /vservers/baz/home. +# Vservers paths are derived from $VROOTDIR. + +EOF + + if [ "$host_or_vservers" == vservers -o "$host_or_vservers" == both ]; then + set -o noglob + echo -e "vsnames = $selected_vservers\n" >> $next_filename + for i in $dup_vsincludes; do + echo "vsinclude = $i" >> $next_filename + done + set +o noglob + fi + + # excludes + cat >> $next_filename <> $next_filename + done + set +o noglob + + cat >> $next_filename <=0.4.2) +# warning: sftp does not support all scp options, especially -i; as +# a workaround, you can use "-o " +#sshoptions = -o IdentityFile=/root/.ssh/id_dsa_duplicity +sshoptions = $dup_sshoptions + +# put the backups under this directory +destdir = $dup_destdir + +# the machine which will receive the backups +desthost = $dup_desthost + +# make the files owned by this user +# note: you must be able to ssh backupuser@backhost +# without specifying a password (if type = remote). +destuser = $dup_destuser + +EOF + + chmod 600 $next_filename + +} + +dup_main_menu() { + + while true; do + srcitem="choose files to include & exclude $_src_done" + destitem="configure backup destination $_dest_done" + gpgitem="configure GnuPG encryption/signing $_gpg_done" + conitem="set up ssh keys and test remote connection $_con_done" + advitem="edit advanced settings $_adv_done" + # TODO: add the following to the menu when do_dup_conn is written + # conn "$conitem" \ + menuBox "$dup_title" "choose a step:" \ + src "$srcitem" \ + dest "$destitem" \ + gpg "$gpgitem" \ + adv "$advitem" \ + finish "finish and create config file" + [ $? = 0 ] || return 1 + result="$REPLY" + + case "$result" in + "src") do_dup_src;; + "dest") do_dup_dest;; + "gpg") do_dup_gpg;; + # TODO: enable the following when do_dup_conn is written + # "conn") do_dup_conn;; + "adv") do_dup_adv;; + "finish") + if [[ "$_dest_done$_gpg_done$_src_done" != "(DONE)(DONE)(DONE)" ]]; then + # TODO: replace the previous test by the following when do_dup_conn is written + # if [[ "$_con_done$_dest_done$_gpg_done$_src_done" != "(DONE)(DONE)(DONE)(DONE)" ]]; then + msgBox "$dup_title" "You cannot create the configuration file until the four first steps are completed." + else + do_dup_finish + break + fi + ;; + esac + + done +} + +### Main function + +dup_wizard() { + + require_packages duplicity + + # Global variables + dup_title="Duplicity action wizard" + _src_done= + _dest_done= + _con_done= + _gpg_done= + _adv_done= + dup_includes= + dup_excludes= + dup_vsincludes= + dup_incremental=yes + dup_keep=60 + dup_bandwidth= + dup_sshoptions= + dup_destdir="/backups/`hostname`" + dup_desthost= + dup_destuser= + dup_gpg_asymmetric_encryption="yes" + dup_gpg_encryptkey="" + dup_gpg_sign="yes" + dup_gpg_onekeypair="yes" + dup_gpg_signkey="" + dup_gpg_password="" + dup_nicelevel=19 + dup_testconnect=yes + dup_options= + + # Global variables whose '*' shall not be expanded + set -o noglob + dup_default_includes="/var/spool/cron/crontabs /var/backups /etc /root /home /usr/local/*bin /var/lib/dpkg/status*" + dup_default_excludes="/home/*/.gnupg /home/*/.gnupg /home/*/.local/share/Trash /home/*/.Trash /home/*/.thumbnails /home/*/.beagle /home/*/.aMule /home/*/gtk-gnutella-downloads" + set +o noglob + + dup_main_menu +} diff --git a/handlers/dup.in b/handlers/dup.in new file mode 100644 index 0000000..00f4b58 --- /dev/null +++ b/handlers/dup.in @@ -0,0 +1,263 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- +# +# duplicity script for backupninja +# requires duplicity +# + +getconf options +getconf testconnect yes +getconf nicelevel 0 +getconf tmpdir + +setsection gpg +getconf password +getconf sign no +getconf encryptkey +getconf signkey + +setsection source +getconf include +getconf vsnames all +getconf vsinclude +getconf exclude + +setsection dest +getconf incremental yes +getconf keep 60 +getconf sshoptions +getconf bandwidthlimit 0 +getconf desthost +getconf destdir +getconf destuser +destdir=${destdir%/} + +### SANITY CHECKS ############################################################## + +[ -n "$destdir" ] || fatal "Destination directory not set" +[ -n "$include" ] || fatal "No source includes specified" +[ -n "$password" ] || fatal "The password option must be set." + +### VServers +# If vservers are configured, check that the ones listed in $vsnames do exist. +local usevserver=no +if [ $vservers_are_available = yes ]; then + if [ "$vsnames" = all ]; then + vsnames="$found_vservers" + else + if ! vservers_exist "$vsnames" ; then + fatal "At least one of the vservers listed in vsnames ($vsnames) does not exist." + fi + fi + if [ -n "$vsinclude" ]; then + info "Using vservers '$vsnames'" + usevserver=yes + fi +else + [ -z "$vsinclude" ] || warning 'vservers support disabled in backupninja.conf, vsincludes configuration lines will be ignored' +fi + +### See if we can login on $desthost +if [ "$testconnect" == "yes" ]; then + debug "ssh $sshoptions -o PasswordAuthentication=no $desthost -l $destuser 'echo -n 1'" + if [ ! $test ]; then + result=`ssh $sshoptions -o PasswordAuthentication=no $desthost -l $destuser 'echo -n 1'` + if [ "$result" != "1" ]; then + fatal "Can't connect to $desthost as $destuser." + else + debug "Connected to $desthost as $destuser successfully" + fi + fi +fi + +### COMMAND-LINE MANGLING ###################################################### + +### initialize $execstr* +execstr_command= +execstr_options="$options --no-print-statistics" +execstr_source= +execstr_serverpart="scp://$destuser@$desthost/$destdir" + +### duplicity version +duplicity_version="`duplicity --version | @AWK@ '{print $2}'`" +duplicity_major="`echo $duplicity_version | @AWK@ -F '.' '{print $1}'`" +duplicity_minor="`echo $duplicity_version | @AWK@ -F '.' '{print $2}'`" +duplicity_sub="`echo $duplicity_version | @AWK@ -F '.' '{print $3}'`" + +### ssh/scp/sftp options +# 1. duplicity >= 0.4.2 needs --sftp-command +# (NB: sftp does not support the -l option) +# 2. duplicity 0.4.3 to 0.4.9 replace --ssh-command with --ssh-options, which is +# passed to scp and sftp commands by duplicity. We don't use it: since this +# version does not use the ssh command anymore, we keep compatibility with +# our previous config files by passing $sshoptions to --scp-command and +# --sftp-command ourselves + +scpoptions="$sshoptions" +[ "$bandwidthlimit" == 0 ] || scpoptions="$scpoptions -l $bandwidthlimit" + +# < 0.4.2 : only uses ssh and scp +if [ "$duplicity_major" -le 0 -a "$duplicity_minor" -le 4 -a "$duplicity_sub" -lt 2 ]; then + execstr_options="${execstr_options} --scp-command 'scp $scpoptions' --ssh-command 'ssh $sshoptions'" +# >= 0.4.2 : also uses sftp, --sftp-command option is now supported +else + sftpoptions="$sshoptions" + # == 0.4.2 : uses ssh, scp and sftp + if [ "$duplicity_major" -eq 0 -a "$duplicity_minor" -eq 4 -a "$duplicity_sub" -eq 2 ]; then + execstr_options="${execstr_options} --scp-command 'scp $scpoptions' --sftp-command 'sftp $sftpoptions' --ssh-command 'ssh $sshoptions'" + # >= 0.4.3 : uses only scp and sftp, --ssh-command option is not supported anymore + else + execstr_options="${execstr_options} --scp-command 'scp $scpoptions' --sftp-command 'sftp $sftpoptions'" + fi +fi + +### Symmetric or asymmetric (public/private key pair) encryption +if [ -n "$encryptkey" ]; then + execstr_options="${execstr_options} --encrypt-key $encryptkey" + debug "Data will be encrypted with the GnuPG key $encryptkey." +else + debug "Data will be encrypted using symmetric encryption." +fi + +### Data signing (or not) +if [ "$sign" == yes ]; then + # duplicity is not able to sign data when using symmetric encryption + [ -n "$encryptkey" ] || fatal "The encryptkey option must be set when signing." + # if needed, initialize signkey to a value that is not empty (checked above) + [ -n "$signkey" ] || signkey="$encryptkey" + execstr_options="${execstr_options} --sign-key $signkey" + debug "Data will be signed will the GnuPG key $signkey." +else + debug "Data won't be signed." +fi + +### Incremental or full backup mode +# If incremental==yes, use the default duplicity behaviour: perform an +# incremental backup if old signatures can be found, else switch to +# full backup. +# If incremental==no, force a full backup anyway. +if [ "$incremental" == "no" ]; then + # before 0.4.4, full was an option and not a command + if [ "$duplicity_major" -le 0 -a "$duplicity_minor" -le 4 -a "$duplicity_sub" -lt 4 ]; then + execstr_options="${execstr_options} --full" + else + execstr_command="full" + fi +fi + +### Temporary directory +precmd= +if [ -n "$tmpdir" ]; then + if [ ! -d "$tmpdir" ]; then + info "Temporary directory ($tmpdir) does not exist, creating it." + mkdir -p "$tmpdir" + [ $? -eq 0 ] || fatal "Could not create temporary directory ($tmpdir)." + fi + info "Using $tmpdir as TMPDIR" + precmd="${precmd}TMPDIR=$tmpdir " +fi + +### Cleanup old backup sets (or not) +if [ "$keep" != "yes" ]; then + if [ "`echo $keep | tr -d 0-9`" == "" ]; then + keep="${keep}D" + fi + # before 0.4.4, remove-older-than was an option and not a command + if [ "$duplicity_major" -le 0 -a "$duplicity_minor" -le 4 -a "$duplicity_sub" -lt 4 ]; then + execstr_options="${execstr_options} --remove-older-than $keep" + fi +fi + +### Source + +set -o noglob + +# excludes +for i in $exclude; do + str="${i//__star__/*}" + execstr_source="${execstr_source} --exclude '$str'" +done + +# includes +for i in $include; do + [ "$i" != "/" ] || fatal "Sorry, you cannot use 'include = /'" + str="${i//__star__/*}" + execstr_source="${execstr_source} --include '$str'" +done + +# vsincludes +if [ $usevserver = yes ]; then + for vserver in $vsnames; do + for vi in $vsinclude; do + str="${vi//__star__/*}" + str="$VROOTDIR/$vserver$str" + execstr_source="${execstr_source} --include '$str'" + done + done +fi + +set +o noglob + +### EXECUTE #################################################################### + +execstr_source=${execstr_source//\\*/\\\\\\*} + +### Cleanup commands (duplicity >= 0.4.4) + +# cleanup +if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 4 -a "$duplicity_sub" -ge 4 ]; then + debug "$precmd duplicity cleanup $execstr_options $execstr_serverpart" + if [ ! $test ]; then + export PASSPHRASE=$password + output=`nice -n $nicelevel \ + su -c \ + "$precmd duplicity cleanup $execstr_options $execstr_serverpart 2>&1"` + exit_code=$? + if [ $exit_code -eq 0 ]; then + debug $output + info "Duplicity cleanup finished successfully." + else + debug $output + warning "Duplicity cleanup failed." + fi + fi +fi + +# remove-older-than +if [ "$keep" != "yes" ]; then + if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 4 -a "$duplicity_sub" -ge 4 ]; then + debug "$precmd duplicity remove-older-than $keep $execstr_options $execstr_serverpart" + if [ ! $test ]; then + export PASSPHRASE=$password + output=`nice -n $nicelevel \ + su -c \ + "$precmd duplicity remove-older-than $keep $execstr_options $execstr_serverpart 2>&1"` + exit_code=$? + if [ $exit_code -eq 0 ]; then + debug $output + info "Duplicity remove-older-than finished successfully." + else + debug $output + warning "Duplicity remove-older-than failed." + fi + fi + fi +fi + +### Backup command +debug "$precmd duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart" +if [ ! $test ]; then + export PASSPHRASE=$password + output=`nice -n $nicelevel \ + su -c \ + "$precmd duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart 2>&1"` + exit_code=$? + if [ $exit_code -eq 0 ]; then + debug $output + info "Duplicity finished successfully." + else + debug $output + fatal "Duplicity failed." + fi +fi + +return 0 diff --git a/handlers/ldap.helper.in b/handlers/ldap.helper.in new file mode 100644 index 0000000..9251826 --- /dev/null +++ b/handlers/ldap.helper.in @@ -0,0 +1,90 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- + +HELPERS="$HELPERS ldap:ldap_database_backup" + +ldap_create_file() { +while true; do + checkBox "ldap action wizard" "check options (slapcat OR ldapsearch)" \ + "slapcat" "export ldif using slapcat" yes \ + "ldapsearch" "export ldif using ldapsearch" no \ + "compress" "compress the ldif output files" yes \ + "ssl" "use SSL (deprecated)" no \ + "tls" "use TLS extended operations (RFC2246, RFC2830)" yes + status=$? + compress="compress = no" + method="method = " + restart="restart = no" + binddn="" + passwordfile="" + ssl="ssl = no" + tls="tls = no" + [ $status = 1 ] && return; + result="$REPLY" + for opt in $result; do + case $opt in + '"compress"') compress="compress = yes";; + '"slapcat"') + method="method = slapcat" + [ "$_RESTART" == "yes" ] && restart="restart = yes" + ;; + '"ldapsearch"') + method="method = ldapsearch" + inputBox "ldap action wizard" "ldapsearch requires authentication. Specify here what password file to use. It must have the password with no trailing return and it should not be world readable." + [ $? = 1 ] && return + passwordfile="passwordfile = $REPLY" + inputBox "ldap action wizard" "ldapsearch requires authentication. Specify here what DN to bind as:" + [ $? = 1 ] && return + binddn="binddn = $REPLY" + require_packages ldap-utils + ;; + '"ssl"') ssl="ssl = yes";; + '"tls"') tls="tls = yes";; + esac + done + get_next_filename $configdirectory/30.ldap + cat > $next_filename <&1` + code=$? + if [ "$code" == "0" ]; then + debug $output + info "Successfully finished ldif export of $dbsuffix" + else + warning $output + warning "Failed ldif export of $dbsuffix" + fi + + if [ "$restart" == "yes" ]; then + debug "Starting ldap server..." + /etc/init.d/slapd start + fi + fi + done +fi + +return 0 diff --git a/handlers/maildir.in b/handlers/maildir.in new file mode 100644 index 0000000..3514153 --- /dev/null +++ b/handlers/maildir.in @@ -0,0 +1,370 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- + +############################################################### +# +# This handler slowly creates a backup of each user's maildir +# to a remote server. It is designed to be run with low overhead +# in terms of cpu and bandwidth so it runs pretty slow. +# Hardlinking is used to save storage space. +# +# This handler expects that your maildir directory structure is +# either one of the following: +# +# 1. /$srcdir/[a-zA-Z0-9]/$user for example: +# /var/maildir/a/anarchist +# /var/maildir/a/arthur +# ... +# /var/maildir/Z/Zaphod +# /var/maildir/Z/Zebra +# +# 2. or the following: +# /var/maildir/domain.org/user1 +# /var/maildir/domain.org/user2 +# ... +# /var/maildir/anotherdomain.org/user1 +# /var/maildir/anotherdomain.org/user2 +# ... +# +# if the configuration is setup to have keepdaily at 3, +# keepweekly is 2, and keepmonthly is 1, then each user's +# maildir backup snapshot directory will contain these files: +# daily.1 +# daily.2 +# daily.3 +# weekly.1 +# weekly.2 +# monthly.1 +# +# The basic algorithm is to rsync each maildir individually, +# and to use hard links for retaining historical data. +# +# We handle each maildir individually because it becomes very +# unweldy to hardlink and rsync many hundreds of thousands +# of files at once. It is much faster to take on smaller +# chunks at a time. +# +# For the backup rotation to work, destuser must be able to run +# arbitrary bash commands on the desthost. +# +# Any maildir which is deleted from the source will be moved to +# "deleted" directory in the destination. It is up to you to +# periodically remove this directory or old maildirs in it. +# +############################################################## + +getconf rotate yes +getconf remove yes +getconf backup yes + +getconf loadlimit 5 +getconf speedlimit 0 +getconf keepdaily 5 +getconf keepweekly 3 +getconf keepmonthly 1 + +getconf srcdir /var/maildir +getconf destdir +getconf desthost +getconf destport 22 +getconf destuser +getconf destid_file /root/.ssh/id_rsa + +getconf multiconnection notset + +failedcount=0 +# strip trailing / +destdir=${destdir%/} +srcdir=${srcdir%/} + +[ -d $srcdir ] || fatal "source directory $srcdir doesn't exist" + +[ "$multiconnection" == "notset" ] && fatal "The maildir handler uses a very different destination format. See the example .maildir for more information" + +if [ $test ]; then + testflags="--dry-run -v" +fi + +rsyncflags="$testflags -e 'ssh -p $destport -i $destid_file' -r -v --ignore-existing --delete --size-only --bwlimit=$speedlimit" +excludes="--exclude '.Trash/\*' --exclude '.Mistakes/\*' --exclude '.Spam/\*'" + +################################################################## +### FUNCTIONS + +function do_user() { + local user=$1 + local btype=$2 + local userdir=${3%/} + local source="$srcdir/$userdir/$user/" + local target="$destdir/$userdir/$user/$btype.1" + if [ ! -d $source ]; then + warning "maildir $source not found" + return + fi + + debug "syncing" + ret=`$RSYNC -e "ssh -p $destport -i $destid_file" -r \ + --links --ignore-existing --delete --size-only --bwlimit=$speedlimit \ + --exclude '.Trash/*' --exclude '.Mistakes/*' --exclude '.Spam/*' \ + $source $destuser@$desthost:$target \ + 2>&1` + ret=$? + # ignore 0 (success) and 24 (file vanished before it could be copied) + if [ $ret != 0 -a $ret != 24 ]; then + warning "rsync $user failed" + warning " returned: $ret" + let "failedcount = failedcount + 1" + if [ $failedcount -gt 100 ]; then + fatal "100 rsync errors -- something is not working right. bailing out." + fi + fi + ssh -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file "date +%c%n%s > $target/created" +} + +# remove any maildirs from backup which might have been deleted +# and add new ones which have just been created. +# (actually, it just moved them to the directory "deleted") + +function do_remove() { + local tmp1=`maketemp maildir-tmp-file` + local tmp2=`maketemp maildir-tmp-file` + + ssh -p $destport -i $destid_file $destuser@$desthost mkdir -p "$destdir/deleted" + cd "$srcdir" + for userdir in `ls -d1 */`; do + ls -1 "$srcdir/$userdir" | sort > $tmp1 + ssh -p $destport $destuser@$desthost ls -1 "$destdir/$userdir" | sort > $tmp2 + for deluser in `join -v 2 $tmp1 $tmp2`; do + [ "$deluser" != "" ] || continue + info "removing $destuser@$desthost:$destdir/$userdir$deluser/" + ssh -p $destport $destuser@$desthost mv "$destdir/$userdir$deluser/" "$destdir/deleted" + ssh -p $destport -i $destid_file $destuser@$desthost "date +%c%n%s > '$destdir/$userdir$deluser/deleted_on'" + done + done + rm $tmp1 + rm $tmp2 +} + +function do_rotate() { + [ "$rotate" == "yes" ] || return; + local user=$1 + local userdir=${2%/} + local backuproot="$destdir/$userdir/$user" +( + ssh -T -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file < 0; i-- )); do + if [ -d \$dir.\$i ]; then + if [ -f \$dir.\$i/created ]; then + created=\`tail -1 \$dir.\$i/created\` + else + created=0 + fi + cutoff_time=\$(( now - (seconds*(i-1)) )) + if [ ! \$created -gt \$cutoff_time ]; then + next=\$(( i + 1 )) + if [ ! -d \$dir.\$next ]; then + echo "Debug: \$rottype.\$i --> \$rottype.\$next" + mv \$dir.\$i \$dir.\$next + date +%c%n%s > \$dir.\$next/rotated + else + echo "Debug: skipping rotation of \$dir.\$i because \$dir.\$next already exists." + fi + else + echo "Debug: skipping rotation of \$dir.\$i because it was created" \$(( (now-created)/86400)) "days ago ("\$(( (now-cutoff_time)/86400))" needed)." + fi + fi + done + done + + max=\$((keepdaily+1)) + if [ \( \$keepweekly -gt 0 -a -d $backuproot/daily.\$max \) -a ! -d $backuproot/weekly.1 ]; then + echo "Debug: daily.\$max --> weekly.1" + mv $backuproot/daily.\$max $backuproot/weekly.1 + date +%c%n%s > $backuproot/weekly.1/rotated + fi + + max=\$((keepweekly+1)) + if [ \( \$keepmonthly -gt 0 -a -d $backuproot/weekly.\$max \) -a ! -d $backuproot/monthly.1 ]; then + echo "Debug: weekly.\$max --> monthly.1" + mv $backuproot/weekly.\$max $backuproot/monthly.1 + date +%c%n%s > $backuproot/monthly.1/rotated + fi + + for rottype in daily weekly monthly; do + max=\$((keep\${rottype}+1)) + dir="$backuproot/\$rottype" + oldest=\`find $backuproot -maxdepth 1 -type d -name \$rottype'.*' | @SED@ 's/^.*\.//' | sort -n | tail -1\` + [ "\$oldest" == "" ] && oldest=0 + # if we've rotated the last backup off the stack, remove it. + for (( i=\$oldest; i >= \$max; i-- )); do + if [ -d \$dir.\$i ]; then + if [ -d $backuproot/rotate.tmp ]; then + echo "Debug: removing rotate.tmp" + rm -rf $backuproot/rotate.tmp + fi + echo "Debug: moving \$rottype.\$i to rotate.tmp" + mv \$dir.\$i $backuproot/rotate.tmp + fi + done + done +####### END REMOTE SCRIPT ####### +EOF +) | (while read a; do passthru $a; done) + +} + + +function setup_remote_dirs() { + local user=$1 + local backuptype=$2 + local userdir=${3%/} + local dir="$destdir/$userdir/$user/$backuptype" + local tmpdir="$destdir/$userdir/$user/rotate.tmp" +( + ssh -T -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file < $backuptype.1" + cp -alf $dir.2/. $dir.1 + #if [ \$? == 1 ]; then + # echo "Fatal: could not create hard links to $dir.1 on host $desthost" + # exit 1 + #fi + fi + fi + [ -f $dir.1/created ] && rm $dir.1/created + [ -f $dir.1/rotated ] && rm $dir.1/rotated + exit 0 +EOF +) | (while read a; do passthru $a; done) + + if [ $? == 1 ]; then exit; fi +} + +function start_mux() { + if [ "$multiconnection" == "yes" ]; then + debug "Starting dummy ssh connection" + ssh -p $destport -i $destid_file $destuser@$desthost sleep 1d & + sleep 1 + fi +} + +function end_mux() { + if [ "$multiconnection" == "yes" ]; then + debug "Stopping dummy ssh connection" + ssh -p $destport -i $destid_file $destuser@$desthost pkill sleep + fi +} + +### +################################################################## + +# see if we can login +debug "ssh -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file 'echo -n 1'" +if [ ! $test ]; then + result=`ssh -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file 'echo -n 1' 2>&1` + if [ "$result" != "1" ]; then + fatal "Can't connect to $desthost as $destuser using $destid_file." + fi +fi + +end_mux +start_mux + +## SANITY CHECKS ## +status=`ssh -p $destport -i $destid_file $destuser@$desthost "[ -d \"$destdir\" ] && echo 'ok'"` +if [ "$status" != "ok" ]; then + end_mux + fatal "Destination directory $destdir doesn't exist!" + exit +fi + +### REMOVE OLD MAILDIRS ### + +if [ "$remove" == "yes" ]; then + do_remove +fi + +### MAKE BACKUPS ### + +if [ "$backup" == "yes" ]; then + if [ $keepdaily -gt 0 ]; then btype=daily + elif [ $keepweekly -gt 0 ]; then btype=weekly + elif [ $keepmonthly -gt 0 ]; then btype=monthly + else fatal "keeping no backups"; fi + + if [ "$testuser" != "" ]; then + cd "$srcdir/${user:0:1}" + do_rotate $testuser + setup_remote_dirs $testuser $btype + do_user $testuser $btype + else + [ -d "$srcdir" ] || fatal "directory $srcdir not found." + cd "$srcdir" + for userdir in `ls -d1 */`; do + [ -d "$srcdir/$userdir" ] || fatal "directory $srcdir/$userdir not found." + cd "$srcdir/$userdir" + debug $userdir + for user in `ls -1`; do + [ "$user" != "" ] || continue + debug "$user $userdir" + do_rotate $user $userdir + setup_remote_dirs $user $btype $userdir + do_user $user $btype $userdir + done + done + fi +fi + +end_mux + diff --git a/handlers/makecd.helper.in b/handlers/makecd.helper.in new file mode 100644 index 0000000..f83b541 --- /dev/null +++ b/handlers/makecd.helper.in @@ -0,0 +1,97 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- + +HELPERS="$HELPERS makecd:makecd_backup" +wizardname="makecd action wizard" + +declare -a makecd_excludes + +makecd_wizard() { + + inputBox "$wizardname" "specify a burner type cd or dvd:" + [ $? = 1 ] && return + burnertype="burnertype = $REPLY" + + booleanBox "$wizardname" "Make iso image only? or burn" + if [ $? = 0 ]; then + isoonly="isoonly = yes" + else + isoonly="isoonly = no" + fi + + # backupdir + inputBox "$wizardname" "Directory where to store the backups:" + [ $? = 1 ] && return + backupdir="backupdir = $REPLY" + + inputBox "$wizardname" "what name to give to the image file?" + [ $? = 1 ] && return + imagefile="imagefile = $REPLY" + + inputBox "$wizardname" "specify a burner device:" + [ $? = 1 ] && return + device="device = $REPLY" + + # target - root of system to be included + inputBox "$wizardname" "root of filesystem for burn:" + [ $? = 1 ] && return + target="target = $REPLY" + + + # excludes + + formBegin "$wizardname: excludes" + for ((i=0; i < ${#makecd_excludes[@]} ; i++)); do + formItem exclude ${makecd_excludes[$i]} + done + formItem exclude + formItem exclude + formItem exclude + formItem exclude + formItem exclude + formItem exclude + formItem exclude + formItem exclude + formItem exclude + formDisplay + [ $? = 1 ] && return; + + unset makecd_excludes + makecd_excludes=($REPLY) + + get_next_filename $configdirectory/20.makecd + cat >> $next_filename <> $next_filename + done + + chmod 600 $next_filename +} + diff --git a/handlers/makecd.in b/handlers/makecd.in new file mode 100644 index 0000000..1a95d6d --- /dev/null +++ b/handlers/makecd.in @@ -0,0 +1,88 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- +# +# burncd handler script for backupninja +# +getconf backupdir /var/backups/makecd +getconf exclude +getconf target +getconf burnertype cd +getconf system no +getconf isoonly yes +getconf imagefile backup.iso +getconf device +getconf nicelevel 0 + +# define needed executables: +MKISOFS="/usr/bin/genisoimage" +GROWISOFS="/usr/bin/growisofs" +CDRECORD="/usr/bin/wodim" +CDRDAO="/usr/bin/cdrdao" +DVDINFO="/usr/bin/dvd+rw-mediainfo" + +# create backup dirs and check existence of progs. + +[ -d $backupdir ] || mkdir -p $backupdir +[ -d $backupdir ] || fatal "Backup directory '$backupdir'" +[ -e "$target" ] || fatal "target does not exist " + +[ -x "$MKISOFS" ] || debug 3 "echo executable $MKISOFS not present" +[ -x "$GROWISOFS" ] || debug 3 "echo executable $GROWISOFS not present" +[ -x "$CDRECORD" ] || debug 3 "echo executable $CDRECORD not present" +[ -x "$CDRDAO" ] || debug 3 "echo executable $CDRDAO not present" + +if [ "$isoonly" == "no" ]; then + [ -e $device ] || fatal "No Burner device available" +fi + +outputfile="$backupdir/$imagefile" +execstr="nice -n $nicelevel $MKISOFS --quiet -R -o $outputfile " + +str="" +# excludes +for i in $exclude; do + str=" -x ${i}$str" +done + +debug 0 "echo $str " +execstr="${execstr} $str $target " +debug 0 "echo $execstr " + +output=` $execstr 2>&1 ` +code=$? +if [ "$code" == "0" ]; then + debug $output + info "Successfully finished creation of iso" +else + warning $output + warning "Failed to create iso" +fi + +if [ "$isoonly" == "no" ]; then + + if [ "$burnertype" == "cd" ]; then + # burning iso to CD + $CDRECORD -v gracetime=2 dev=$device speed=8 -dao -data $outputfile + code=$? + if [ "$code" == "0" ]; then + debug $output + info "Successfully burned CD" + else + warning $output + warning "Failed to create CD" + fi + fi + if [ "$burnertype" == "dvd" ]; then + # burning iso dvd + $GROWISOFS -speed=2 -Z $device=$outputfile -use-the-force-luke=notray -use-the-force-luke=tty + code=$? + if [ "$code" == "0" ]; then + debug $output + info "Successfully burned DVD" + else + warning $output + warning "Failed to create DVD" + fi + fi +fi +return 0 + diff --git a/handlers/mysql.helper.in b/handlers/mysql.helper.in new file mode 100644 index 0000000..9622d41 --- /dev/null +++ b/handlers/mysql.helper.in @@ -0,0 +1,212 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- + +HELPERS="$HELPERS mysql:mysql_database_backup" + +do_mysql_vserver() { + choose_one_vserver "$mysql_title" + [ $? = 0 ] || return 1 + mysql_vsname="vsname = $REPLY" +} + +do_mysql_databases() { + REPLY= + while [ -z "$REPLY" ]; do + formBegin "$mysql_title: databases" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formDisplay + [ $? = 0 ] || return 1 + mysql_databases="databases = " + for i in $REPLY; do + [ -n "$i" ] && mysql_databases="$mysql_databases $i" + done + done +} + +do_mysql_password() { + inputBox "$mysql_title" "specify a mysql user:" + [ $? = 1 ] && return + user=$REPLY + inputBox "$mysql_title" "specify the mysql user's password:" + [ $? = 1 ] && return + password=$REPLY + do_mysql_final "dbusername = $user\ndbpassword = $password" +} + +do_mysql_debian() { + _DISABLE_HOTCOPY=yes + do_mysql_final "configfile = /etc/mysql/debian.cnf" +} + +do_mysql_user() { + inputBox "$mysql_title" "what system user does mysql backup use?" + [ $? = 1 ] && return + do_mysql_final "user = $REPLY" +} + +do_mysql_final() { + if [ -z "$_DISABLE_HOTCOPY" ]; then + checkBox "$mysql_title" "check options" \ + "sqldump" "create a backup using mysqldump (more compat)." no \ + "hotcopy" "create a backup using mysqlhotcopy (faster)." yes \ + "compress" "compress the sql output files" yes + status=$? + sqldump="sqldump = no" + hotcopy="hotcopy = no" + else + checkBox "$mysql_title" "check options" \ + "compress" "compress the sql output files" yes + status=$? + sqldump="sqldump = yes" + hotcopy="hotcopy = no" + fi + + [ $status = 1 ] && return; + result="$REPLY" + compress="compress = no" + for opt in $result; do + case $opt in + '"sqldump"') sqldump="sqldump = yes";; + '"hotcopy"') hotcopy="hotcopy = yes";; + '"compress"') compress="compress = yes";; + esac + done + get_next_filename $configdirectory/20.mysql + + cat >> $next_filename < (default = no) +# make a backup of the actual database binary files using mysqlhotcopy. +$hotcopy + +# sqldump = < yes | no > (default = no) +# make a backup using mysqldump. this creates text files with sql commands +# sufficient to recontruct the database. +# +$sqldump + +# compress = < yes | no > (default = yes) +# if yes, compress the sqldump output. +$compress + +# dbhost = (default = localhost) + +EOF + cat >> $next_filename < (default: /var/backups/mysql) +# where to dump the backups. hotcopy backups will be in a subdirectory +# 'hotcopy' and sqldump backups will be in a subdirectory 'sqldump' +$mysql_backupdir + +# databases = (default = all) +# which databases to backup. should either be the word 'all' or a +# space separated list of database names. +$mysql_databases + +EOF + +if [ $host_or_vservers == vservers ] + then + cat >> $next_filename < (no default) +# vsname indicates which vserver to operate on, this is only used if +# vserver is set to yes in /etc/backupninja.conf +# NOTE: if you do not specify a vsname the host will be operated on +# alsoNOTE: if operating on a vserver, $VROOTDIR will be +# prepended to backupdir. +EOF + echo -e "$mysql_vsname\n" >> $next_filename +fi + + echo -e $@ >> $next_filename + + chmod 600 $next_filename +} + +mysql_wizard() { + + # Global variables + mysql_title="MySQL action wizard" + + # backup the host system or a Vserver? + choose_host_or_one_vserver "$mysql_title" + [ $? = 0 ] || return 1 + if [ $host_or_vservers == vservers ] + then + do_mysql_vserver + [ $? = 0 ] || return 1 + fi + + # backupdir + if [ $host_or_vservers == vservers ] + then + inputBox "$mysql_title" "Directory where to store the backups:`echo \"\n(Relative to chosen vserver's root directory)\"`" "/var/backups/mysql" + else + inputBox "$mysql_title" "Directory where to store the backups" "/var/backups/mysql" + fi + [ $? = 1 ] && return + mysql_backupdir="backupdir = $REPLY" + + # databases + booleanBox "$mysql_title" "Do you want to backup all of the databases? `echo \"\n\nIf not, you'll be offered to choose individual databases to backup.\"`" + if [ $? = 0 ]; then + mysql_databases="databases = all" + else + do_mysql_databases + [ $? = 0 ] || return 1 + fi + + while true; do + _DISABLE_HOTCOPY= + menuBoxHelpFile "$mysql_title" "choose a mysql authentication method:" \ + user "change to a linux user first." \ + password "manually specify mysql user and password." \ + debian "use default mysql user debian-sys-maint." + status=$? + if [ $status = 2 ]; then + # show help. + helptmp="/tmp/backupninja.help.$$" + cat > $helptmp < $mycnf <&1` + code=$? + if [ "$code" == "0" ] + then + debug $output + info "Successfully finished hotcopy of all mysql databases" + else + warning $output + warning "Failed to hotcopy all mysql databases" + fi + fi + else + for db in $databases + do + if [ $usevserver = yes ] + then + execstr="$VSERVER $vsname exec $MYSQLHOTCOPY --allowold $db $hotdir" + else + execstr="$MYSQLHOTCOPY --allowold $db $hotdir" + fi + debug 'su $user -c \"$execstr\"' + if [ ! $test ] + then + output=`su $user -c "$execstr" 2>&1` + code=$? + if [ "$code" == "0" ] + then + debug $output + info "Successfully finished hotcopy of mysql database $db" + else + warning $output + warning "Failed to hotcopy mysql database $db" + fi + fi + done + fi +fi + +########################################################################## +## SQL DUMP + +if [ "$sqldump" == "yes" ] +then + info "Initializing SQL dump method" + if [ "$databases" == "all" ] + then + if [ $usevserver = yes ] + then + debug 'echo show databases | $VSERVER $vsname exec su $user -c \"$MYSQL $defaultsfile\" | grep -v Database' + databases=`echo 'show databases' | $VSERVER $vsname exec su $user -c "$MYSQL $defaultsfile" | grep -v Database` + if [ $? -ne 0 ] + then + fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?" + fi + else + databases=$(su $user -c "$MYSQL $defaultsfile -N -B -e 'show databases'" | sed 's/|//g;/\+----/d') + if [ $? -ne 0 ] + then + fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?" + fi + fi + fi + + for db in $databases + do + DUMP_BASE="$MYSQLDUMP $defaultsfile --lock-tables --complete-insert --add-drop-table --quick --quote-names" + + # Dumping structure and data + DUMP="$DUMP_BASE $ignore $db" + + # If requested, dump only the table structure for this database + if echo "$nodata" | grep -E '(^|[[:space:]])'"$db\." >/dev/null + then + # Get the structure of the tables, without data + DUMP_STRUCT="$DUMP_BASE --no-data $db" + for qualified_table in $nodata + do + table=$( expr match "$qualified_table" "$db\.\([^\w]*\)" ) + DUMP_STRUCT="$DUMP_STRUCT $table" + done + DUMP="( $DUMP; $DUMP_STRUCT )" + fi + if [ $usevserver = yes ] + then + # Test to make sure mysqld is running, if it is not sqldump will not work + $VSERVER $vsname exec su $user -c "$MYSQLADMIN $defaultsfile ping" + if [ $? -ne 0 ]; then + fatal "Either you have an authentication problem, or mysqld doesn't appear to be running!" + fi + if [ "$compress" == "yes" ]; then + execstr="$VSERVER $vsname exec $DUMP | $GZIP > $vroot$dumpdir/${db}.sql.gz" + else + execstr="$VSERVER $vsname exec $DUMP -r $vroot$dumpdir/${db}.sql" + fi + else + # Test to make sure mysqld is running, if it is not sqldump will not work + su $user -c "$MYSQLADMIN $defaultsfile ping" + if [ $? -ne 0 ]; then + fatal "Either you have an authentication problem, or mysqld doesn't appear to be running!" + fi + if [ "$compress" == "yes" ]; then + execstr="$DUMP | $GZIP > $dumpdir/${db}.sql.gz" + else + execstr="$DUMP -r $dumpdir/${db}.sql" + fi + fi + debug "su $user -c \"$execstr\"" + if [ ! $test ] + then + output=`su $user -c "$execstr" 2>&1` + code=$? + if [ "$code" == "0" ] + then + debug $output + info "Successfully finished dump of mysql database $db" + else + warning $output + warning "Failed to dump mysql databases $db" + fi + fi + done +fi + +# clean up tmp config file +if [ "$dbusername" != "" -a "$dbpassword" != "" ] +then + ## clean up tmp config file + debug "rm $mycnf" + rm $mycnf + if [ -f "$tmpcnf" ] + then + debug "mv $tmpcnf $mycnf" + mv $tmpcnf $mycnf + fi +fi + +return 0 diff --git a/handlers/pgsql.helper.in b/handlers/pgsql.helper.in new file mode 100644 index 0000000..8024616 --- /dev/null +++ b/handlers/pgsql.helper.in @@ -0,0 +1,107 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- + +HELPERS="$HELPERS pgsql:postgresql_database_backup" + +do_pgsql_vserver() { + choose_one_vserver "$pgsql_title" + [ $? = 0 ] || return 1 + pgsql_vsname="vsname = $REPLY" +} + +do_pgsql_databases() { + REPLY= + while [ -z "$REPLY" ]; do + formBegin "$pgsql_title: databases" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formItem "Database:" + formDisplay + [ $? = 0 ] || return 1 + pgsql_databases="databases = " + for i in $REPLY; do + [ -n "$i" ] && pgsql_databases="$pgsql_databases $i" + done + done +} + +pgsql_wizard() { + + # constants + pgsql_title="PostgreSQL action wizard" + + # backup the host system or a Vserver? + choose_host_or_one_vserver "$pgsql_title" + [ $? = 0 ] || return 1 + if [ $host_or_vservers == vservers ]; then + do_pgsql_vserver + [ $? = 0 ] || return 1 + fi + + # backupdir + inputBox "$pgsql_title" "Directory where to store the backups:`[ -z \"$pgsql_vsname\" ] || echo \"\n(In respect to chosen vserver's root directory)\"`" "/var/backups/postgres" + [ $? = 1 ] && return + pgsql_backupdir="backupdir = $REPLY" + + # databases + booleanBox "$pgsql_title" "Do you want to backup the whole cluster? If not, you'll be offered to choose the databases to backup." + if [ $? = 0 ]; then + pgsql_databases="databases = all" + else + do_pgsql_databases + [ $? = 0 ] || return 1 + fi + + # compress + booleanBox "$pgsql_title" "Do you want to compress the backups?" + if [ $? = 0 ]; then + pgsql_compress="compress = yes" + else + pgsql_compress="compress = no" + fi + + # write config file + get_next_filename $configdirectory/20.pgsql + cat >> $next_filename < (no default) +# what vserver to operate on, only used if vserver = yes in /etc/backupninja.conf +# if you do not specify a vsname the host will be operated on +# Note: if operating on a vserver, $VROOTDIR will be prepended to backupdir. +EOF + if [ $host_or_vservers == vservers ]; then + echo -e "$pgsql_vsname\n" >> $next_filename + fi + + cat >> $next_filename < (default: /var/backups/postgres) +# where to dump the backups +$pgsql_backupdir + +# databases = < all | db1 db2 db3 > (default = all) +# which databases to backup. should either be the word 'all' or a +# space separated list of database names. +# Note: when using 'all', pg_dumpall is used instead of pg_dump, which means +# that cluster-wide data (such as users and groups) are saved. +$pgsql_databases + +# compress = < yes | no > (default = yes) +# if yes, compress the pg_dump/pg_dumpall output. +$pgsql_compress + +### You can also set the following variables in backupninja.conf: +# PGSQLDUMP: pg_dump path (default: /usr/bin/pg_dump) +# PGSQLDUMPALL: pg_dumpall path (default: /usr/bin/pg_dumpall) +# PGSQLUSER: user running PostgreSQL (default: postgres) + +EOF + chmod 600 $next_filename + +} diff --git a/handlers/pgsql.in b/handlers/pgsql.in new file mode 100644 index 0000000..f334bf2 --- /dev/null +++ b/handlers/pgsql.in @@ -0,0 +1,133 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- +# +# PostgreSQL handler script for backupninja +# + +getconf backupdir /var/backups/postgres +getconf databases all +getconf compress yes +getconf vsname + +localhost=`hostname` + +# Decide if the handler should operate on a vserver or on the host. +# In the former case, check that $vsname exists and is running. +local usevserver=no +local vroot +if [ $vservers_are_available = yes ]; then + if [ -n "$vsname" ]; then + # does it exist ? + if ! vservers_exist "$vsname" ; then + fatal "The vserver given in vsname ($vsname) does not exist." + fi + # is it running ? + vservers_running $vsname || fatal "The vserver $vsname is not running." + # everything ok + info "Using vserver '$vsname'." + usevserver=yes + vroot="$VROOTDIR/$vsname" + else + info "No vserver name specified, actions will be performed on the host." + fi +fi + +# Make sure that the system to backup has the needed executables +if [ $usevserver = yes ]; then + debug "Examining vserver '$vsname'." + if [ "$databases" == "all" ]; then + [ -x "$vroot`$VSERVER $vsname exec which $PGSQLDUMPALL`" ] || \ + fatal "Can't find $PGSQLDUMPALL in vserver $vsname." + else + [ -x "$vroot`$VSERVER $vsname exec which $PGSQLDUMP`" ] || \ + fatal "Can't find $PGSQLDUMP in vserver $vsname." + fi +else + if [ "$databases" == "all" ]; then + [ -x "`which $PGSQLDUMPALL`" ] || \ + fatal "Can't find $PGSQLDUMPALL." + else + [ -x "`which $PGSQLDUMP`" ] || \ + fatal "Can't find $PGSQLDUMP." + fi +fi + +# create backup dir, the vroot variable will be empty if no vsname was specified +# and will proceed to operate on the host +[ -d $vroot$backupdir ] || (debug "mkdir -p $vroot$backupdir"; mkdir -p $vroot$backupdir) +[ -d $vroot$backupdir ] || fatal "Backup directory '$vroot$backupdir' does not exist, and could not be created." + +# give backup dir the good uid and permissions +# (in respect to the vserver, if $usevserver = yes) +if [ $usevserver = yes ]; then + pguid=`$VSERVER $vsname exec getent passwd $PGSQLUSER | @AWK@ -F: '{print $3}'` +else + pguid=`getent passwd $PGSQLUSER | @AWK@ -F: '{print $3}'` +fi +[ -n "$pguid" ] || \ + fatal "No user called $PGSQLUSER`[ $usevserver = no ] || echo \" on vserver $vsname\"`." +debug "chown $pguid $vroot$backupdir" +chown $pguid $vroot$backupdir +debug "chmod 700 $vroot$backupdir" +chmod 700 $vroot$backupdir + +# if $databases = all, use pg_dumpall +if [ "$databases" == "all" ]; then + if [ $usevserver = yes ]; then + if [ "$compress" == "yes" ]; then + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP > $backupdir/${vsname}.sql.gz\"" + else + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL > $backupdir/${vsname}.sql\"" + fi + else + if [ "$compress" == "yes" ]; then + execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP > $backupdir/${localhost}-all.sql.gz\"" + else + execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL > $backupdir/${localhost}-all.sql\"" + fi + fi + debug "$execstr" + if [ ! $test ]; then + output=`eval $execstr 2>&1` + code=$? + if [ "$code" == "0" ]; then + debug $output + info "Successfully finished dump of pgsql cluster" + else + warning $output + warning "Failed to dump pgsql cluster" + fi + fi + +# else use pg_dump on each specified database +else + for db in $databases; do + if [ $usevserver = yes ]; then + if [ "$compress" == "yes" ]; then + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP > $backupdir/${db}.sql.gz\"" + else + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | > $backupdir/${db}.sql\"" + fi + else + if [ "$compress" == "yes" ]; then + execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP > $backupdir/${db}.sql.gz\"" + else + execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db > $backupdir/${db}.sql\"" + fi + fi + debug "$execstr" + if [ ! $test ]; then + output=`eval $execstr 2>&1` + code=$? + if [ "$code" == "0" ]; then + debug $output + info "Successfully finished dump of pgsql database ${db}" + else + warning $output + warning "Failed to dump pgsql database ${db}" + fi + fi + done +fi + +return 0 + diff --git a/handlers/rdiff.helper.in b/handlers/rdiff.helper.in new file mode 100644 index 0000000..1055280 --- /dev/null +++ b/handlers/rdiff.helper.in @@ -0,0 +1,407 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- + +HELPERS="$HELPERS rdiff:incremental_remote_filesystem_backup" + +declare -a rdiff_includes +declare -a rdiff_excludes +declare -a rdiff_vsincludes +declare -a rdiff_vsexcludes + +# FUNCTIONS + +do_rdiff_host_includes() { + set -o noglob + # choose the files to backup + REPLY= + while [ -z "$REPLY" ]; do + formBegin "$rdiff_title - host system: includes" + for ((i=0; i < ${#rdiff_includes[@]} ; i++)); do + formItem include ${rdiff_includes[$i]} + done + formItem include + formItem include + formItem include + formDisplay + [ $? = 0 ] || return + unset rdiff_includes + rdiff_includes=($REPLY) + done + set +o noglob +} + +do_rdiff_vserver() { + # choose the vservers to backup (into $selected_vservers) + choose_one_or_more_vservers "$rdiff_title" + [ $? = 0 ] || return 1 + + set -o noglob + # choose the files to backup + REPLY= + + while [ -z "$REPLY" ]; do + formBegin "$rdiff_title - vsincludes (backup these directories from every vserver)" + [ -z "$rdiff_vsincludes" ] && rdiff_vsincludes="$rdiff_default_includes" + + for i in $rdiff_vsincludes; do + formItem include "$i" + done + formItem include "" + formItem include "" + formItem include "" + formDisplay + [ $? = 0 ] || return 1 + rdiff_vsincludes=($REPLY) + done + + set +o noglob +} + +do_rdiff_excludes() { + set -o noglob + formBegin "$rdiff_title: excludes" + for ((i=0; i < ${#rdiff_excludes[@]} ; i++)) + do + formItem exclude ${rdiff_excludes[$i]} + done + formItem exclude + formItem exclude + formDisplay + [ $? = 0 ] || return + unset rdiff_excludes + rdiff_excludes=($REPLY) + set +o noglob +} + +do_rdiff_src() { + choose_host_or_vservers_or_both "$rdiff_title" + [ $? = 0 ] || return 1 + case $host_or_vservers in + 'host') + do_rdiff_host_includes + [ $? = 0 ] || return 1 + ;; + 'vservers') + do_rdiff_vserver + [ $? = 0 ] || return 1 + ;; + 'both') + do_rdiff_host_includes + [ $? = 0 ] || return 1 + do_rdiff_vserver + [ $? = 0 ] || return 1 + ;; + *) + return 1 + ;; + esac + do_rdiff_excludes + [ $? = 0 ] || return 1 + _src_done="(DONE)" + setDefault dest +} + +do_rdiff_dest() { + declare -a tmp_array + + set -o noglob + REPLY= + while [ -z "$REPLY" -o -z "$rdiff_directory" -o -z "$rdiff_host" -o -z "$rdiff_user" ] + do + formBegin "$rdiff_title - destination: last three items are required" + formItem "keep" "$rdiff_keep" + formItem "dest_directory" "$rdiff_directory" + formItem "dest_host" "$rdiff_host" + formItem "dest_user" "$rdiff_user" + formItem "dest_type" "$rdiff_type" + formDisplay + [ $? = 0 ] || return + tmp_array=($REPLY) + rdiff_keep=${tmp_array[0]} + rdiff_directory=${tmp_array[1]} + rdiff_host=${tmp_array[2]} + rdiff_user=${tmp_array[3]} + rdiff_type=${tmp_array[4]} + done + set +o noglob + + _dest_done="(DONE)" + setDefault conn +} + +do_rdiff_ssh_con() { + local remote_status="ok" + + IFS=$' \t\n' + if [ "$_dest_done" = "" ]; then + msgBox "$rdiff_title: error" "You must first configure the destination." + return + elif [ "$rdiff_type" = "" ]; then + msgBox "$rdiff_title: error" "You must first configure the destination backup type." + return + elif [ "$rdiff_user" = "" ]; then + msgBox "$rdiff_title: error" "You must first configure the destination user." + return + elif [ "$rdiff_host" = "" ]; then + msgBox "$rdiff_title: error" "You must first configure the destination host." + return + else + booleanBox "$rdiff_title" "This step will create a ssh key for the local root user with no passphrase (if one does not already exist), and attempt to copy root's public ssh key to authorized_keys file of $rdiff_user@$rdiff_host. This will allow the local root to make unattended backups to $rdiff_user@$rdiff_host.\n\n\nAre you sure you want to continue?" + [ $? = 0 ] || return + fi + + if [ ! -f /root/.ssh/id_dsa.pub -a ! -f /root/.ssh/id_rsa.pub ]; then + echo "Creating local root's ssh key" + ssh-keygen -t dsa -f /root/.ssh/id_dsa -N "" + echo "Done. hit return to continue" + read + fi + + ssh -o PreferredAuthentications=publickey $rdiff_host -l $rdiff_user "exit" 2> /dev/null + if [ $? -ne 0 ]; then + echo "Copying root's public ssh key to authorized_keys of $rdiff_user@$rdiff_host. When prompted, specify the password for user $rdiff_user@$rdiff_host." + ssh-copy-id -i /root/.ssh/id_[rd]sa.pub $rdiff_user@$rdiff_host + if [ $? -ne 0 ]; then + echo "FAILED: Couldn't copy root's public ssh key to authorized_keys of $rdiff_user@$rdiff_host." + ssh $rdiff_user@$rdiff_host 'test -w .ssh || test -w .' + result=$? + echo "Hit return to continue." + read + case $result in + 0 ) msgBox "$rdiff_title: error" "Directories are writable: Probably just a typo the first time." ;; + 1 ) msgBox "$rdiff_title: error" "Connected successfully to $rdiff_user@$rdiff_host, but unable to write. Check ownership and modes of ~$rdiff_user on $rdiff_host." ;; + 255 ) msgBox "$rdiff_title: error" "Failed to connect to $rdiff_user@$rdiff_host. Check hostname, username, and password. Also, make sure sshd is running on the destination host." ;; + * ) msgBox "$rdiff_title: error" "Unexpected error." ;; + esac + return + else + echo "Done. hit return to continue" + read + fi + else + echo "root@localhost is already in authorized_keys of $rdiff_user@$rdiff_host." + echo "Hit return to continue." + read + fi + + # test to see if the remote rdiff backup directory exists and is writable + echo "Testing to see if remote rdiff backup directory exists and is writable" + ssh $rdiff_user@$rdiff_host "test -d ${rdiff_directory}" + if [ $? = 0 ]; then + ssh $rdiff_user@$rdiff_host "test -w $rdiff_directory" + if [ $? != 0 ]; then + msgBox "destination directory is not writable!" "The remote destination directory is not writable by the user you specified. Please fix the permissions on the directory and then try again." + remote_status=failed + fi + else + booleanBox "Remote directory does not exist" "The destination backup directory does not exist, do you want me to create it for you?" + if [ $? = 0 ]; then + ssh $rdiff_user@$rdiff_host "mkdir -p ${rdiff_directory}" + result=$? + case $result in + 0) msgBox "$rdiff_title: success" "Creation of the remote destination directory was a success!";; + 1) msgBox "$rdiff_title: error" "Connected successfully to $rdiff_user@$rdiff_host, but was unable to create the destination directory, check the directory permissions." + remote_status=failed;; + 255) msgBox "$rdiff_title: error" "Failed to connect to $rdiff_user@$rdiff_host. Check hostname, username, and password. Also, make sure sshd is running on the destination host." + remote_status=failed;; + *) msgBox "$rdiff_title: error" "Unexpected error." + remote_status=failed;; + esac + fi + fi + + if [ "$remote_status" = "ok" ]; then + do_rdiff_con + fi +} + +do_rdiff_con() { + echo "Checking for local install of rdiff-backup" + require_packages rdiff-backup + + echo "Testing to make sure destination has rdiff-backup installed and is compatible." + remote_result=`/usr/bin/rdiff-backup --test-server $rdiff_user@$rdiff_host::/ 2>&1 >&-` + if [ $? -ne 0 ]; then + echo $remote_result | grep -q "command not found" + if [ $? -eq 0 ]; then + if [ "$rdiff_user" = "root" ]; then + booleanBox "install rdiff-backup?" "It seems like the remote machine does not have rdiff-backup installed, I can attempt to install rdiff-backup on the remote machine.\n\n\nDo you want me to attempt this now?" + if [ $? = 0 ]; then + ssh $rdiff_user@$rdiff_host 'apt-get install rdiff-backup' + result=$? + echo "Hit return to continue." + read + case $result in + 0) msgBox "$rdiff_title: success" "Installation of rdiff-backup was a success!" + do_rdiff_con;; + 1) msgBox "$rdiff_title: error" "Connected successfully to $rdiff_user@$rdiff_host, but was unable to install the package for some reason.";; + 255) msgBox "$rdiff_title: error" "Failed to connect to $rdiff_user@$rdiff_host. Check hostname, username, and password. Also, make sure sshd is running on the destination host.";; + *) msgBox "$rdiff_title: error" "Unexpected error.";; + esac + return + fi + else + booleanBox "install rdiff-backup" "Please install rdiff-backup on the remote machine, this cannot be done automatically, as the remote user in your configuration is not root. \n\nIf you have installed rdiff-backup on the remote machine and you are getting this error, then there is a version incompatibility between that version and the local version.\n\nPlease resolve this problem and then try connecting again.\n\n\n\nTry connecting again?" + if [ $? = 0 ]; then + do_rdiff_con + else + return + fi + fi + else + msgBox "incompatible versions of rdiff-backup" "It looks like rdiff-backup is installed on the remote machine, but it may be an incompatible version with the one installed locally, or something else is amiss.\n\nPlease resolve this problem and then try connecting again.\n\n\nTry connecting again?" + if [ $? = 0 ]; then + do_rdiff_con + else + return + fi + fi + else + echo "SUCCESS: Everything looks good!" + echo "Hit return to continue." + read + fi + + _con_done="(DONE)" + setDefault finish +} + +do_rdiff_finish() { + get_next_filename $configdirectory/90.rdiff + cat > $next_filename <> $next_filename + done + set +o noglob + fi + + if [ "$host_or_vservers" == vservers -o "$host_or_vservers" == both ]; then + cat >> $next_filename < ... (default = all) +# vsinclude = +# vsinclude = +# ... +# Any path specified in vsinclude is added to the include list for each vserver +# listed in vsnames (or all if vsnames = all, which is the default). +# +# For example, vsinclude = /home will backup the /home directory in every +# vserver listed in vsnames. If you have 'vsnames = foo bar baz', this +# vsinclude will add to the include list /vservers/foo/home, /vservers/bar/home +# and /vservers/baz/home. +# Vservers paths are derived from $VROOTDIR. + +EOF + set -o noglob + echo -e "vsnames = $selected_vservers\n" >> $next_filename + for i in $rdiff_vsincludes; do + echo "vsinclude = $i" >> $next_filename + done + set +o noglob + fi + + ## excludes ## + set -o noglob + for ((i=0; i < ${#rdiff_excludes[@]} ; i++)); do + echo exclude = ${rdiff_excludes[$i]} >> $next_filename + done + set +o noglob + cat >> $next_filename <&1`" + if [ $? = 0 ]; then + debug $output + info "Removing backups older than $keep days succeeded." + else + warning $output + warning "Failed removing backups older than $keep." + fi + fi + +fi + +# Add cstream + +if [ ! -z $bwlimit ]; then + check_cstream $CSTREAM; + if [ "$desttype" = "remote" ]; then + RDIFFBACKUP="$RDIFFBACKUP --remote-schema 'cstream -t $bwlimit | ssh %s \''rdiff-backup --server\'''" + elif [ "$sourcetype" = "remote" ]; then + RDIFFBACKUP="$RDIFFBACKUP --remote-schema 'ssh %s \''rdiff-backup --server\'' | cstream -t $bwlimit'" + else + fatal "You specified a bandwidth limit but neither your source nor destination types are remote." + fi +fi + +### EXECUTE ### + +execstr="$RDIFFBACKUP $options --print-statistics " + +set -o noglob + +symlinks_warning="Maybe you have mixed symlinks and '*' in this statement, which is not supported." + +# TODO: order the includes and excludes +# excludes +for i in $exclude; do + str="${i//__star__/*}" + execstr="${execstr}--exclude '$str' " +done +# includes +for i in $include; do + [ "$i" != "/" ] || fatal "Sorry, you cannot use 'include = /'" + str="${i//__star__/*}" + execstr="${execstr}--include '$str' " +done + +# vsinclude +if [ $usevserver = yes ]; then + for vserver in $vsnames; do + for vi in $vsinclude; do + str="${vi//__star__/*}" + str="$VROOTDIR/$vserver$str" + if [ -n "$str" ]; then + execstr="${execstr}--include '$str' " + else + warning "vsinclude statement '${vi//__star__/*}' will be ignored for VServer $vserver. $symlinks_warning" + fi + done + done +fi + +set +o noglob + +# exclude everything else +[ "$include" != "" -o "$vsinclude" != "" ] && execstr="${execstr}--exclude '/*' " + +# include client-part and server-part +execstr="${execstr}$execstr_sourcepart $execstr_destpart" + +debug "$execstr" +if [ $test = 0 ]; then + output=`nice -n $nicelevel su -c "$execstr" 2>&1` + if [ $? = 0 ]; then + debug $output + info "Successfully finished backing up source $label" + else + warning $output + warning "Failed backup up source $label" + fi +fi + +return 0 diff --git a/handlers/rsync.in b/handlers/rsync.in new file mode 100644 index 0000000..9baa2f2 --- /dev/null +++ b/handlers/rsync.in @@ -0,0 +1,350 @@ +# +# backupninja handler to do incremental backups using +# rsync and hardlinks, based on +# +# http://www.mikerubel.org/computers/rsync_snapshots/ +# +# feedback: rhatto at riseup.net | gpl +# lot of enhancements grabbed from "rsnap" handler by paulv at bikkel.org +# +# Config file options +# ------------------- +# +# [general] +# log = rsync log file +# partition = partition where the backup lives +# fscheck = set to 1 if fsck should run on $partition after the backup is made +# read_only = set to 1 if $partition is mounted read-only +# mountpoint = backup partition mountpoint or backup main folder +# backupdir = folder relative do $mountpoint where the backup should be stored +# days = number of backup increments (min = 5) +# lockfile = lockfile to be kept during backup execution +# nicelevel = rsync command nice level +# enable_mv_timestamp_bug = set to "yes" if your system isnt handling timestamps correctly +# tmp = temp folder +# +# [source] +# from = local or remote +# host = source hostname or ip, if remote backup +# testconnect = when "yes", test the connection for a remote source before backup +# include = include folder on backup +# exclude = exclude folder on backup +# ssh = ssh command line (remote only) +# rsync = rsync program +# rsync_options = rsync command options +# exclude_vserver = vserver-name (valid only if vservers = yes on backupninja.conf) +# numericids = when set to 1, use numeric ids instead of user/group mappings on rsync +# compress = if set to 1, compress data on rsync (remote source only) +# bandwidthlimit = set a badnwidth limit in kbps (remote source only) +# remote_rsync = remote rsync program (remote source only) +# +# [services] +# initscripts = absolute path where scripts are located +# service = script name to be stoped at the begining of the backup and started at its end +# +# You can also specify some system comands if you don't want the default system values: +# +# [system] +# rm = rm command +# cp = cp command +# touch = touch command +# mv = mv command +# fsck = fsck command +# +# You dont need to manually specify vservers using "include = /vservers". +# They are automatically backuped if vserver is set to "yes" on you backupninja.conf. +# + +# config file evaluation + +setsection system +getconf rm rm +getconf cp cp +getconf touch touch +getconf mv mv +getconf fsck fsck + +setsection general +getconf log /var/log/backup/rsync.log +getconf partition +getconf fscheck +getconf read_only +getconf mountpoint +getconf backupdir +getconf rotate +getconf days +getconf lockfile +getconf nicelevel 0 +getconf enable_mv_timestamp_bug no +getconf tmp /tmp + +setsection source +getconf from local +getconf testconnect no +getconf rsync $RSYNC +getconf rsync_options "-av --delete" +getconf ssh ssh +getconf user +getconf host +getconf include +getconf exclude +getconf exclude_vserver +getconf numericids 0 +getconf compress 0 +getconf bandwidthlimit +getconf remote_rsync rsync + +setsection services +getconf initscripts +getconf service + +# function definitions + +function rotate { + + if [[ "$2" < 4 ]]; then + error "Rotate: minimum of 4 rotations" + exit 1 + fi + + if [ -d $1.$2 ]; then + $nice $mv /$1.$2 /$1.tmp + fi + + for ((n=`echo "$2 - 1" | bc`; n >= 0; n--)); do + if [ -d $1.$n ]; then + dest=`echo "$n + 1" | bc` + $nice $mv /$1.$n /$1.$dest + $touch /$1.$dest + fi + done + + if [ -d $1.tmp ]; then + $nice $mv /$1.tmp /$1.0 + fi + + if [ -d $1.1 ]; then + $nice $cp -alf /$1.1/. /$1.0 + fi + +} + +function move_files { + + ref=$tmp/makesnapshot-mymv-$$; + $touch -r $1 $ref; + $mv $1 $2; + $touch -r $ref $2; + $rm $ref; + +} + +backupdir="$mountpoint/$backupdir" + +# does $backupdir exists? + +if [ ! -d "$backupdir" ]; then + error "Backupdir $backupdir does not exist" + exit 1 +fi + +# setup number of increments + +if [ -z "$days" ]; then + keep="4" +else + keep="`echo $days - 1 | bc -l`" +fi + +# lockfile setup + +if [ ! -z "$lockfile" ]; then + $touch $lockfile || warning "Could not create lockfile $lockfile" +fi + +# nicelevel setup + +if [ ! -z "$nicelevel" ]; then + nice="nice -n $nicelevel" +else + nice="" +fi + +# connection test + +if [ "$from" == "remote" ] && [ "$testconnect" == "yes" ]; then + debug "$ssh -o PasswordAuthentication=no $user@$host 'echo -n 1'" + result=`ssh -o PasswordAuthentication=no $user@$host 'echo -n 1'` + if [ "$result" != "1" ]; then + fatal "Can't connect to $host as $user." + else + debug "Connected to $srchost successfully" + fi +fi + +# rsync options for local sources + +if [ "$from" == "local" ]; then + + rsync_local_options="$rsync_options" + + if [ ! -z "$numericids" ]; then + rsync_local_options="$rsync_local_options --numeric-ids " + fi + +fi + +# rsync options for remote sources + +if [ "$from" == "remote" ]; then + + rsync_remote_options="$rsync_options --rsync-path=$remote_rsync" + + if [ "$compress" == "1" ]; then + rsync_remote_options="$rsync_remote_options --compress" + fi + + if [ ! -z "$bandwidthlimit" ]; then + rsync_remote_options="$rsync_remote_options --bwlimit=$bandwidthlimit" + fi + + if [ ! -z "$numericids" ]; then + rsync_remote_options="$rsync_remote_options --numeric-ids" + fi + +fi + +# set mv procedure + +if [ $enable_mv_timestamp_bug == "yes" ]; then + mv=move_files +fi + +# set excludes + +for path in $exclude; do + EXCLUDES="$EXCLUDES --exclude=$path" +done + +# stop services + +if [ ! -z "$service" ]; then + for daemon in $service; do + info "Stopping service $daemon..." + $initscripts/$daemon stop + done +fi + +echo "Starting backup at `date`" >> $log + +# mount backup destination folder as read-write + +if [ "$read_only" == "1" ] || [ "$read_only" == "yes" ]; then + if [ -d "$mountpoint" ]; then + mount -o remount,rw $mountpoint + if (($?)); then + error "Could not mount $mountpoint" + exit 1 + fi + fi +fi + +# add vservers to included folders + +if [ "$vservers_are_available" == "yes" ]; then + + # sane permission on backup + mkdir -p $backupdir/$VROOTDIR + chmod 000 $backupdir/$VROOTDIR + + for candidate in $found_vservers; do + candidate="`basename $candidate`" + found_excluded_vserver="0" + for excluded_vserver in $exclude_vserver; do + if [ "$excluded_vserver" == "$candidate" ]; then + found_excluded_vserver="1" + break + fi + done + if [ "$found_excluded_vserver" == "0" ]; then + include="$include $VROOTDIR/$candidate" + fi + done +fi + +# the backup procedure + +for SECTION in $include; do + + section="`basename $SECTION`" + + if [ ! -d "$backupdir/$SECTION/$section.0" ]; then + mkdir -p $backupdir/$SECTION/$section.0 + fi + + info "Rotating $backupdir/$SECTION/$section..." + echo "Rotating $backupdir/$SECTION/$section..." >> $log + rotate $backupdir/$SECTION/$section $keep + info "Syncing $SECTION on $backupdir/$SECTION/$section.0..." + + if [ "$from" == "local" ]; then + debug $rsync $rsync_local_options $EXCLUDES /$SECTION/ $backupdir/$SECTION/$section.0/ + $nice $rsync $rsync_local_options $EXCLUDES /$SECTION/ $backupdir/$SECTION/$section.0/ >> $log + if [ "$?" != "0" ]; then + warning "Rsync error when trying to transfer $SECTION" + fi + elif [ "$from" == "remote" ]; then + if [ -z "$user" ] || [ -z "$host" ]; then + error "Config file error: either user or host was not specified" + exit 1 + else + debug $nice $rsync $rsync_remote_options $EXCLUDES -e "$ssh" $user@$host:/$SECTION/ $backupdir/$SECTION/$section.0 + $nice $rsync $rsync_remote_options $EXCLUDES -e "$ssh" $user@$host:/$SECTION/ $backupdir/$SECTION/$section.0 >> $log + if [ "$?" != "0" ]; then + warning "Rsync error when trying to transfer $SECTION" + fi + fi + else + error "Invalid source $from" + exit 1 + fi + + $touch $backupdir/$SECTION/$section.0 + +done + +# remount backup destination as read-only + +if [ "$read_only" == "1" ] || [ "$read_only" == "yes" ]; then + mount -o remount,ro $mountpoint +fi + +# check partition for errors + +if [ "$fscheck" == "1" ] || [ "$fscheck" == "yes" ]; then + umount $mountpoint + if (($?)); then + warning "Could not umount $mountpoint to run fsck" + else + $nice $fsck -v -y $partition >> $log + mount $mountpoint + fi +fi + +# restart services + +if [ ! -z "$service" ]; then + for daemon in $service; do + info "Starting service $daemon..." + $initscripts/$daemon start + done +fi + +# removes the lockfile + +if [ ! -z "$lockfile" ]; then + $rm $lockfile || warning "Could not remove lockfile $lockfile" +fi + +echo "Finnishing backup at `date`" >> $log + diff --git a/handlers/sh.in b/handlers/sh.in new file mode 100644 index 0000000..f9f1926 --- /dev/null +++ b/handlers/sh.in @@ -0,0 +1,7 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- +# +# shell script handler for backupninja +# runs the file /etc/backup.d/scriptname.sh +# + +[ $test ] || ( . $1 ) diff --git a/handlers/svn.in b/handlers/svn.in new file mode 100644 index 0000000..d19b0b8 --- /dev/null +++ b/handlers/svn.in @@ -0,0 +1,77 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- +# +# this handler will backup subversion repostitories. +# + +getconf src /var/lib/svn +getconf dest /var/backups/svn +getconf tmp /var/backups/svn.tmp +getconf HOTBACKUP "/usr/bin/svnadmin hotcopy" +getconf vsname + +error=0 + +# Decide if the handler should operate on a vserver or on the host. +# In the former case, check that $vsname exists and is running. +local usevserver=no +local vroot +if [ $vservers_are_available = yes ]; then + if [ -n "$vsname" ]; then + # does it exist ? + if ! vservers_exist "$vsname" ; then + fatal "The vserver given in vsname ($vsname) does not exist." + fi + # is it running ? + vservers_running $vsname || fatal "The vserver $vsname is not running." + # everything ok + info "Using vserver '$vsname'." + usevserver=yes + vroot="$VROOTDIR/$vsname" + else + info "No vserver name specified, actions will be performed on the host." + fi +fi + +cd $vroot$src +for repo in `find . -name svnserve.conf` +do + repo=`dirname $repo` + repo=`dirname $repo` + + ret=`mkdir -p $vroot$tmp/$repo 2>&1` + code=$? + if [ "$ret" ]; then + debug "$ret" + fi + if [ $code != 0 ]; then + error "command failed mkdir -p $vroot$tmp/$repo" + fi + + if [ $usevserver = yes ] + then + ret=`$VSERVER $vsname exec $HOTBACKUP $src/$repo $tmp/$repo 2>&1` + else + ret=`$HOTBACKUP $src/$repo $tmp/$repo 2>&1` + fi + code=$? + if [ "$ret" ]; then + debug "$ret" + fi + if [ $code != 0 ]; then + error "command failed -- $HOTBACKUP $vroot$src/$repo $vroot$tmp/$repo" + error=1 + fi +done + +if [ $error -eq 1 ]; then + echo "Error: because of earlier errors, we are leaving svn backups in $vroot$tmp instead of $vroot$dest" +else + if [ -d $vroot$dest -a -d $vroot$tmp ]; then + rm -rf $vroot$dest + fi + if [ -d $vroot$tmp ]; then + mv $vroot$tmp $vroot$dest + fi +fi + +exit 0 diff --git a/handlers/sys.helper.in b/handlers/sys.helper.in new file mode 100644 index 0000000..d3d99a5 --- /dev/null +++ b/handlers/sys.helper.in @@ -0,0 +1,43 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- + +HELPERS="$HELPERS sys:general_hardware_and_system_info" + +sys_wizard() { + require_packages hwinfo debconf-utils + checkBox "new sys action" "check options" \ + "packages" "list of all installed packages." on \ + "partitions" "the partition table of all disks." on \ + "sfdisk" "use sfdisk to get partition information." on \ + "hardware" "detailed hardware information" on + [ $? = 1 ] && return; + result="$REPLY" + packages="packages = no" + partitions="partitions = no" + sfdisk="dosfdisk = no" + hardware="hardware = no" + for opt in $result; do + case $opt in + '"packages"') packages="packages = yes";; + '"partitions"') partitions="partitions = yes";; + '"sfdisk"') sfdisk="dosfdisk = yes";; + '"hardware"') hardware="hardware = yes";; + esac + done + get_next_filename $configdirectory/10.sys + cat > $next_filename < ... (default = all) +EOF + chmod 600 $next_filename +} + diff --git a/handlers/sys.in b/handlers/sys.in new file mode 100755 index 0000000..f293840 --- /dev/null +++ b/handlers/sys.in @@ -0,0 +1,543 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- +# +# this handler will save various reports of vital system information. +# by default, all the reports are enabled and are saved in /var/backups. +# +# (1) a capture of the debconf package selection states. This file +# can be used to restore the answers to debconf questions for +# packages that you will be installing through (2) below. To +# do this, run: "debconf-set-selections < debconfsel.txt" +# +# (2) a list of all the packages installed and removed. +# this file can be used to restore the state of installed packages +# by running "dpkg --set-selections < dpkg-selections.txt and +# then run "apt-get -u dselect-upgrade". If you have the +# debconf-set-selections file from (1), you should restore those first. +# +# (3) the partition table of all disks. +# this partition table can be used to format another disk of +# the same size. this can be handy if using software raid and +# you have a disk go bad. just replace the disk and partition it +# by running "sfdisk /dev/sdb < partitions.sdb.txt" +# (MAKE SURE YOU PARTITION THE CORRECT DISK!!!) +# +# (4) hardware information. +# write to a text file the important things which hwinfo can gleen. +# + +if [ -f /etc/debian_version ] +then + os=debian + debug "Debian detected" + osversion="/etc/debian_version" +elif [ -f /etc/redhat-release ] +then + os=redhat + debug "Redhat detected" + osversion="/etc/redhat-release" +else + warning "Unknown OS detected!" +fi + +getconf parentdir /var/backups +getconf packages yes +getconf dosfdisk yes +getconf dohwinfo yes + +if [ ! -d $parentdir ]; then + mkdir -p $parentdir +fi + +if [ $os = "debian" ] +then + getconf packagesfile $parentdir/dpkg-selections.txt + getconf packagemgr `which dpkg` + getconf packagemgroptions ' --get-selections *' + getconf selectionsfile $parentdir/debconfsel.txt + getconf debconfgetselections `which debconf-get-selections` +elif [ $os = "redhat" ] +then + getconf packagesfile $parentdir/rpmpackages.txt + getconf packagemgr `which rpm` + getconf packagemgroptions ' -qa ' + + getconf SYSREPORT `which sysreport` + getconf sysreport_options ' -norpm ' +else + getconf packagesfile $parentdir/unknownOS.txt +fi +packagemgroptions="${packagemgroptions//__star__/*}" + +getconf partitions yes +getconf partitionsfile $parentdir/partitions.__star__.txt + +getconf hardware yes +getconf hardwarefile $parentdir/hardware.txt + +getconf sysreport yes +getconf sysreportfile $parentdir/sysreport.txt + +getconf SFDISK `which sfdisk` +getconf HWINFO `which hwinfo` +getconf sfdisk_options "" +getconf hwinfo_options "" + +getconf vsnames all + +# If vservers are configured, check that the ones listed in $vsnames are running. +local usevserver=no +if [ $vservers_are_available = yes ]; then + if [ "$vsnames" = all ]; then + vsnames="$found_vservers" + fi + if ! vservers_running "$vsnames" ; then + fatal "At least one of the vservers listed in vsnames ($vsnames) is not running." + fi + info "Using vservers '$vsnames'" + usevserver=yes +fi + +## PACKAGES ############################## + +# +# here we grab a list of the packages installed and removed. +# + +if [ "$packages" == "yes" ]; then + + if [ $usevserver = yes ]; then + info "vserver root directory set to: $VROOTDIR" + for vserver in $vsnames; do + info "examining vserver: $vserver" + # is it running ? + vservers_running $vserver + if [ $? -ne 0 ]; then + warning "The vserver $vserver is not running." + continue + fi + # is $packagemgr available inside $vserver ? + if [ ! -x "${VROOTDIR}/${vserver}${packagemgr}" ]; then + warning "can't find $packagemgr in vserver $vserver, skipping installed packages report." + else + # don't expand * since it can be used in $packagemgroptions + set -o noglob + debug "$VSERVER $vserver exec $packagemgr $packagemgroptions > $VROOTDIR/$vserver$packagesfile" + $VSERVER $vserver exec $packagemgr $packagemgroptions > $VROOTDIR/$vserver$packagesfile || fatal "can not save $packagemgr info to $packagesfile" + set +o noglob + fi + # is $debconfgetselections available inside $vserver ? + found=no + # case #1: it is available on the host, is it available inside $vserver ? + if [ -n "$debconfgetselections" ]; then + [ -x "${VROOTDIR}/${vserver}${debconfgetselections}" ] && found=yes + # case #2: it is not available on the host, is it available inside $vserver ? + else + [ -n "`$VSERVER $vserver exec which debconf-get-selections`" ] && found=yes + fi + if [ "$found" != yes ]; then + warning "can't find debconf-get-selections in vserver $vserver, skipping package selection states. You may want to install the debconf-utils package." + else + debug "$VSERVER $vserver exec $debconfgetselections > $VROOTDIR/$vserver$selectionsfile" + $VSERVER $vserver exec $debconfgetselections > $VROOTDIR/$vserver$selectionsfile || fatal "can not save debconf-get-selections info to $selectionsfile" + fi + unset found + done + fi + + # We want to perform this on the host as well + if [ -z "$packagemgr" -o ! -x "$packagemgr" ]; then + warning "can't find ${packagemgr}, skipping installed packages report." + else + # don't expand * since it can be used in $packagemgroptions + set -o noglob + debug "$packagemgr $packagemgroptions > $packagesfile" + $packagemgr $packagemgroptions > $packagesfile || fatal "can not save $packagemgr info to $packagesfile" + set +o noglob + fi + if [ -z "$debconfgetselections" ]; then + warning "can't find debconf-get-selections, skipping package selection states. You might want to install the debconf-utils package." + else + debug "$debconfgetselections > $selectionsfile" + $debconfgetselections > $selectionsfile || fatal "can not save $debconfgetselections info to $selectionsfile" + fi +fi + +## System report ############################## + +# +# here we grab a bunch of system stuff for a report +# + +export STATUS + +HASHES="#################################################################" +DASHES="-----------------------------------------------------------------" + +cat /dev/null > $sysreportfile || fatal "can not write to $sysreportfile" + + +catiffile () { + echo $HASHES >> $sysreportfile + echo "# $STATUS" >> $sysreportfile + echo $HASHES >> $sysreportfile + if [ -f $1 ]; then + echo "file: $1" >> $sysreportfile + echo $DASHES >> $sysreportfile + cat $1 >> $sysreportfile 2>&1 || info "reading of $1 failed" + fi + if [ -d $1 ]; then + echo "directory: $1" >> $sysreportfile + echo $DASHES >> $sysreportfile + for file in `find $1 -maxdepth 3 -noleaf -type f` + do + catiffile $file + done + fi + echo $DASHES >> $sysreportfile +} + +catifexec () { + if [ -x $1 ]; then + echo $HASHES >> $sysreportfile + echo "# $STATUS" >> $sysreportfile + echo $HASHES >> $sysreportfile + $* >> $sysreportfile 2>&1 || info "executing of $1 failed" + fi +} + + +STATUS="Determining $os version:" +catiffile $osversion + +STATUS="Determinding your current hostname: " +catifexec "/bin/hostname" + +STATUS="Getting the date:" +catifexec "/bin/date" + +STATUS="Checking your systems current uptime and load average:" +catifexec "/usr/bin/uptime" + +STATUS="Checking available memory:" +catifexec "/usr/bin/free" + +STATUS="Checking free disk space:" +catifexec "/bin/df" "-al" + +STATUS="Collecting what services run at what run level:" +if [ $os = "redhat" ]; then + catifexec "/sbin/chkconfig" "--list" + STATUS="Collecting information about /etc/rc.d:" + catiffile "/bin/ls /etc/rc.d/rc*.d/" + +elif [ $os = "debian" ]; then + for level in 0 1 2 3 4 5 6 S; do + echo "Level: $level" >> $sysreportfile + for f in /etc/rc${level}.d/*; do + # Remove /etc/Knn or Snn from beginning + ff=$(echo $f | @SED@ 's_/etc/rc..d/[KS][0-9][0-9]__') + if [ $f != $ff ]; then + echo $ff >> $sysreportfile + fi + done + echo "" >> $sysreportfile + done +fi + +STATUS="Getting bootloader information:" +catifexec "/bin/ls" "-alR /boot" + +# This covers sparc, alpha, and intel (respectively) +# updated for grub -mpg +if [ -f /etc/silo.conf ]; then + STATUS="Collecting information about the boot process (silo):" + catiffile "/etc/silo.conf" +fi +if [ -f /etc/milo.conf ]; then + STATUS="Collecting information about the boot process (milo):" + catiffile "/etc/milo.conf" +fi +if [ -f /etc/lilo.conf ]; then + STATUS="Collecting information about the boot process (lilo):" + catiffile "/etc/lilo.conf" + catifexec "/sbin/lilo" "-q" +fi +if [ -d /boot/grub -a -f /boot/grub/grub.conf -a -f /boot/grub/device.map ]; then + STATUS="Collecting information about the boot process (grub.conf):" + catiffile "/boot/grub/grub.conf" + STATUS="Collecting information about the boot process (grub.map):" + catiffile "/boot/grub/device.map" +fi +if [ -f /etc/cluster.conf -o -f /etc/cluster.xml ] ; then + STATUS="Gathering information on cluster setup" + # 2.1 AS + if [ -f /etc/cluster.conf ] ; then + catiffile "/etc/cluster.conf" + fi + # Taroon + if [ -f /etc/cluster.xml ] ; then + catiffile "/etc/cluster.xml" + fi +fi + +STATUS="Gathering sysctl information (sysctl -a):" +catiffile "sysctl -a 2>/dev/null" +STATUS="Gathering sysctl information (/etc/sysctl.conf):" +catiffile "/etc/sysctl.conf" + +STATUS="Gathering IP information (/sbin/ifconfig):" +catifexec "/sbin/ifconfig" "-a" + +STATUS="Gathering additional IP information (/bin/ip addr list):" +catifexec "/bin/ip" "addr list" + +STATUS="Checking network routes:" +catifexec "/sbin/route" "-n" + +STATUS="Collecting Name Service Switch config information:" +catiffile "/etc/nsswitch.conf" + +STATUS="Collecting information about system authentication (pam):" +catiffile "/etc/pam.conf" +catiffile "/etc/pam.d" + +echo +echo "Getting information about the kernel." +echo +STATUS="Getting kernel version:" +catifexec "/bin/uname" "-a" +STATUS="Checking module information:" +catifexec "/sbin/lsmod" +for x in $(/sbin/lsmod | /bin/cut -f1 -d" " 2>/dev/null | /bin/grep -v Module 2>/dev/null +) ; do + STATUS="Checking module information $x:" + catifexec "/sbin/modinfo" "$x" +done + +STATUS="Gathering information about your filesystems:" +catiffile "/proc/filesystems" + +STATUS="Gathering information about your system stat:" +catiffile "/proc/stat" + +STATUS="Gathering information about your partitions:" +catiffile "/proc/partitions" + +STATUS="Gathering information about your ksyms:" +catiffile "/proc/kallsyms" + +STATUS="Gathering information about slabinfo:" +catiffile "/proc/slabinfo" + +# Added support to cover for the new modules.conf layout in Red Hat 7 +STATUS="Collecting information regarding kernel modules" +VER=`uname -r` +catiffile "/lib/modules/$VER/modules.dep" +if [ -f /etc/conf.modules ]; then + STATUS="Collecting information regarding kernel modules (conf.modules)" + catiffile "/etc/conf.modules" +fi +if [ -f /etc/modules.conf ]; then + STATUS="Collecting information regarding kernel modules (modules.conf)" + catiffile "/etc/modules.conf" +fi +if [ -f /etc/modprobe.conf ]; then + STATUS="Collecting information regarding kernel modules (modeprobe.conf)" + catiffile "/etc/modprobe.conf" +fi + +# dkms status +if [ -x /usr/sbin/dkms ] ; then + STATUS="Gathering current status of modules, versions and kernels (dkms):" + catifexec "/usr/sbin/dkms" "status" +fi + +if [ -f /etc/sysconfig/isdncard ] ; then + STATUS="Gathering information about ISDN:" + catiffile "/etc/sysconfig/isdncard" +fi + +STATUS="Collecting information from the proc directory:" +catiffile "/proc/pci" + +STATUS="Getting kernel command line" +catiffile "/proc/cmdline" + +STATUS="Gathering information about your CPU:" +catiffile "/proc/cpuinfo" + +STATUS="Gathering information about your Ram:" +catiffile "/proc/meminfo" + +STATUS="Gathering information about your ioports:" +catiffile "/proc/ioports" + +STATUS="Gathering information about your interrupts:" +catiffile "/proc/interrupts" + +STATUS="Gathering information about your scsi devices:" +catiffile "/proc/scsi" + +STATUS="Gathering information about your dma:" +catiffile "/proc/dma" + +STATUS="Gathering information about your devices (/proc/devices):" +catiffile "/proc/devices" + +STATUS="Gathering information about your rtc:" +catiffile "/proc/rtc" + +STATUS="Gathering information about your ide drivers:" +catiffile "/proc/ide" + +STATUS="Gathering information about your bus:" +catifexec "/usr/bin/lspci" +catiffile "/proc/bus" + +echo +echo "Getting disk and filesystem information." +echo + +STATUS="Collecting information from /etc/fstab:" +catiffile "/etc/fstab" + +STATUS="Collecting disk partition information:" +catifexec "/sbin/fdisk" "-l" + +STATUS="Checking mounted file systems (mount) " +catifexec "/bin/mount" + +STATUS="Checking mounted file systems (/proc/mounts)" +catiffile "/proc/mounts" + +STATUS="Collecting Software RAID information (/proc/mdstat)" +catiffile "/proc/mdstat" + +STATUS="Collecting Software RAID information (/etc/raidtab)" +catiffile "/etc/raidtab" + +STATUS="Collecting Software RAID information (/etc/mdadm.conf)" +catiffile "/etc/mdadm.conf" + +STATUS="Collecting Software RAID information (/sbin/mdadm -Q)" +catifexec "/sbin/mdadm" "-Q" "--detail" '/dev/md?*' + +STATUS="Collecting Automount information (auto.master)" +catiffile "/etc/auto.master" + +STATUS="Collecting Automount information (auto.misc)" +catiffile "/etc/auto.misc" + +STATUS="Collecting Automount information (auto.net)" +catiffile "/etc/auto.net" + +STATUS="Collecting LVM information:" +if [ $os = "redhat" ]; then + catifexec "/usr/sbin/vgdisplay" "-vv" +elif [ $os = "debian" ]; then + catifexec "/sbin/vgdisplay" "-vv" +fi + +STATUS="Collecting SCSI Tape information (/etc/stinit.def)" +catiffile "/etc/stinit.def" + +if [ -x /sbin/lsusb ] ; then + STATUS="Collecting USB devices list (lsusb):" + catifexec "/sbin/lsusb" +fi + +if [ -x /usr/bin/lshal ] ; then + STATUS="Collecting global devices list (lshal):" + catifexec "/usr/bin/lshal" +fi + + +STATUS="Gathering information on SELinux setup" +catifexec "/usr/bin/selinuxconfig" +catifexec "/usr/sbin/sestatus" +if [ $os = "redhat" ]; then + catifexec "rpm" "-q -V selinux-policy-targeted" + catifexec "rpm" "-q -V selinux-policy-strict" +fi + +if [ $usevserver = yes ]; then + STATUS="Gathering vserver information" + catiffile "/proc/virtual" +fi + +if [ "$partitions" == "yes" ]; then + if [ "$dosfdisk" == "yes" ]; then + if [ ! -x "$SFDISK" ]; then + warning "can't find sfdisk, skipping sfdisk report." + partitions="no" + fi + fi + if [ "$dohwinfo" == "yes" ]; then + if [ ! -x "$HWINFO" ]; then + warning "can't find hwinfo, skipping partition report." + partitions="no" + fi + fi +fi + +if [ "$hardware" == "yes" ]; then + if [ ! -x "$HWINFO" ]; then + warning "can't find hwinfo, skipping hardware report." + hardware="no" + fi +fi + +## HARDWARE ############################# + +# +# here we use hwinfo to dump a table listing all the +# information we can find on the hardware of this machine +# + +if [ "$hardware" == "yes" ]; then + if [ "dohwinfo" == "yes" ]; then + if [ -f $hardwarefile ]; then + rm $hardwarefile + fi + touch $hardwarefile + echo -e "\n\n====================== summary ======================\n" >> $hardwarefile + debug "$HWINFO --short --cpu --network --disk --pci >> $hardwarefile" + $HWINFO --short --cpu --network --disk --pci >> $hardwarefile + for flag in cpu network bios pci; do + echo -e "\n\n====================== $flag ======================\n" >> $hardwarefile + $HWINFO --$flag >> $hardwarefile + done + fi +fi + + +## PARTITIONS ############################# + +# here we use sfdisk to dump a listing of all the partitions. +# these files can be used to directly partition a disk of the same size. + +if [ "$partitions" == "yes" ]; then + if [ "$dosfdisk" == "yes" ]; then + devices=`LC_ALL=C $SFDISK -l 2>/dev/null | grep "^Disk /dev" | @AWK@ '{print $2}' | cut -d: -f1` + if [ "$devices" == "" ]; then + warning "No harddisks found" + fi + for dev in $devices; do + debug "$SFDISK will try to backup partition tables for device $dev" + [ -b $dev ] || continue + label=${dev#/dev/} + label=${label//\//-} + outputfile=${partitionsfile//__star__/$label} + debug "$SFDISK $sfdisk_options -d $dev > $outputfile 2>/dev/null" + $SFDISK $sfdisk_options -d $dev > $outputfile 2>/dev/null + if [ $? -ne 0 ]; then + warning "The partition table for $dev could not be saved." + fi + done + fi + if [ "$dohwinfo" == "yes" ]; then + debug "Using $HWINFO to get all available disk information" + echo -e "\n\n====================== $disk ======================\n" >> $hardwarefile + $HWINFO --disk >> $hardwarefile + fi +fi diff --git a/handlers/tar.helper.in b/handlers/tar.helper.in new file mode 100644 index 0000000..cc9a89b --- /dev/null +++ b/handlers/tar.helper.in @@ -0,0 +1,94 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- + +HELPERS="$HELPERS tar:tar_backup" + +tar_wizard() { + tar_title="Tar action wizard" + + backupname=`hostname --fqdn` + + inputBox "$tar_title" "When to run this action?" "everyday at 01" + [ $? = 1 ] && return + tar_when_run="when = $REPLY" + + inputBox "$tar_title" "\"Name\" of backups" "$backupname" + [ $? = 1 ] && return + tar_backupname="backupname = $REPLY" + backupname="$REPLY" + + inputBox "$tar_title" "Directory where to store the backups" "/net/backups/$backupname" + [ $? = 1 ] && return + tar_backupdir="backupdir = $REPLY" + + radioBox "$tar_title" "Compression" \ + "none" "do not filter trough" off \ + "compress" "filter trough compress" off \ + "gzip" "filter trough gzip" off \ + "bzip" "filter trough bzip" on + [ $? = 1 ] && return; + result="$REPLY" + tar_compress="compress = $REPLY " + + REPLY= + while [ -z "$REPLY" ]; do + formBegin "$tar_title: Includes" + formItem "Include:" /etc + formItem "Include:" /home + formItem "Include:" /usr/local + formItem "Include:" + formItem "Include:" + formItem "Include:" + formItem "Include:" + formItem "Include:" + formItem "Include:" + formItem "Include:" + formItem "Include:" + formDisplay + [ $? = 0 ] || return 1 + tar_includes="includes = " + for i in $REPLY; do + [ -n "$i" ] && tar_includes="$tar_includes $i" + done + done + + REPLY= + while [ -z "$REPLY" ]; do + formBegin "$tar_title: Excludes" + formItem "Exclude:" /tmp + formItem "Exclude:" /proc + formItem "Exclude:" /sys + formItem "Exclude:" /dev + formItem "Exclude:" /srv + formItem "Exclude:" /media + formItem "Exclude:" /misc + formItem "Exclude:" /net + formItem "Exclude:" /selinux + formItem "Exclude:" + formItem "Exclude:" + formDisplay + [ $? = 0 ] || return 1 + tar_excludes="excludes = " + for i in $REPLY; do + [ -n "$i" ] && tar_excludes="$tar_excludes $i" + done + done + +# Save the config + get_next_filename $configdirectory/10.tar + cat > $next_filename < "$backupdir/$backupname-"`$DATE "+$DATEFORMAT"`.list \ + 2> "$backupdir/$backupname-"`$DATE "+$DATEFORMAT"`.err + +[ $? -ne 0 ] && fatal "Tar backup failed" + + + diff --git a/handlers/trac.in b/handlers/trac.in new file mode 100644 index 0000000..a4b7bdf --- /dev/null +++ b/handlers/trac.in @@ -0,0 +1,52 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- +# +# this handler will backup trac environments (based on the svn handler) +# +# http://trac.edgewall.com/ +# + +getconf src /var/lib/trac +getconf dest /var/backups/trac +getconf tmp /var/backups/trac.tmp + +cd $src +for repo in `find . -name VERSION` +do + + repo=`dirname $repo` + if [ "$repo" == "." ] + then + repo="" + fi + + # Just make the parent directory for $tmp/$repo + parentdir=`dirname $tmp/$repo` + ret=`mkdir -p $parentdir 2>&1` + code=$? + if [ "$ret" ]; then + debug "$ret" + fi + if [ $code != 0 ]; then + error "command failed mkdir -p $parentdir" + fi + + ret=`trac-admin $src/$repo hotcopy $tmp/$repo 2>&1` + code=$? + if [ "$ret" ]; then + debug "$ret" + fi + if [ $code != 0 ]; then + error "command failed -- trac-admin $src/$repo hotcopy $tmp/$repo" + fi +done + +if [ -d $dest -a -d $tmp ]; then + rm -rf $dest +fi +if [ -d $tmp ]; then + mv $tmp $dest +fi + +exit 0 + +# vim: filetype=sh diff --git a/handlers/wget b/handlers/wget new file mode 100644 index 0000000..51054ea --- /dev/null +++ b/handlers/wget @@ -0,0 +1,220 @@ +# +# backupninja handler to do incremental backups using +# wget and hardlinks, based on rsync handler +# +# feedback: rhatto at riseup.net | gpl +# +# Config file options +# ------------------- +# +# [general] +# log = wget log file +# partition = partition where the backup lives +# fscheck = set to 1 if fsck should run on $partition after the backup is made +# read_only = set to 1 if $partition is mounted read-only +# mountpoint = backup partition mountpoint or backup main folder +# backupdir = folder relative do $mountpoint where the backup should be stored +# days = number of backup increments (min = 5) +# lockfile = lockfile to be kept during backup execution +# nicelevel = wget command nice level +# enable_mv_timestamp_bug = set to "yes" if your system isnt handling timestamps correctly +# tmp = temp folder +# +# [source] +# wget = wget program +# wget_options = wget command options +# url = remote data url +# bandwidthlimit = set a badnwidth limit in kbps (remote source only) +# +# [destination] +# folder = local folder +# +# You can also specify some system comands if you don't want the default system values: +# +# [system] +# rm = rm command +# cp = cp command +# touch = touch command +# mv = mv command +# fsck = fsck command +# +# TODO: Daily, weekly and monthly snapshot rotation (like the one present on maildir handler). +# + +# config file evaluation + +setsection system +getconf rm rm +getconf cp cp +getconf touch touch +getconf mv mv +getconf fsck fsck + +setsection general +getconf log /var/log/backup/wget.log +getconf partition +getconf fscheck +getconf read_only +getconf mountpoint +getconf backupdir +getconf rotate +getconf days +getconf lockfile +getconf nicelevel 0 +getconf enable_mv_timestamp_bug no +getconf tmp /tmp + +setsection source +getconf wget wget +getconf wget_options +getconf url +getconf bandwidthlimit + +setsection destination +getconf folder + +# function definitions + +function rotate { + + if [[ "$2" < 4 ]]; then + error "Rotate: minimum of 4 rotations" + exit 1 + fi + + if [ -d $1.$2 ]; then + $nice $mv /$1.$2 /$1.tmp + fi + + for ((n=`echo "$2 - 1" | bc`; n >= 0; n--)); do + if [ -d $1.$n ]; then + dest=`echo "$n + 1" | bc` + $nice $mv /$1.$n /$1.$dest + $touch /$1.$dest + fi + done + + if [ -d $1.tmp ]; then + $nice $mv /$1.tmp /$1.0 + fi + + if [ -d $1.1 ]; then + $nice $cp -alf /$1.1/. /$1.0 + fi + +} + +function move_files { + + ref=$tmp/makesnapshot-mymv-$$; + $touch -r $1 $ref; + $mv $1 $2; + $touch -r $ref $2; + $rm $ref; + +} + +backupdir="$mountpoint/$backupdir" + +# does $backupdir exists? + +if [ ! -d "$backupdir" ]; then + error "Backupdir $backupdir does not exist" + exit 1 +fi + +# setup number of increments + +if [ -z "$days" ]; then + keep="4" +else + keep="`echo $days - 1 | bc -l`" +fi + +# lockfile setup + +if [ ! -z "$lockfile" ]; then + $touch $lockfile || warning "Could not create lockfile $lockfile" +fi + +# nicelevel setup + +if [ ! -z "$nicelevel" ]; then + nice="nice -n $nicelevel" +else + nice="" +fi + +# set mv procedure + +if [ $enable_mv_timestamp_bug == "yes" ]; then + mv=move_files +fi + +# set excludes + +for path in $exclude; do + EXCLUDES="$EXCLUDES --exclude=$path" +done + +echo "Starting backup at `date`" >> $log + +# mount backup destination folder as read-write + +if [ "$read_only" == "1" ] || [ "$read_only" == "yes" ]; then + if [ -d "$mountpoint" ]; then + mount -o remount,rw $mountpoint + if (($?)); then + error "Could not mount $mountpoint" + exit 1 + fi + fi +fi + +# the backup procedure + +if [ ! -d "$backupdir/$folder/$folder.0" ]; then + mkdir -p $backupdir/$folder/$folder.0 +fi + +info "Rotating $backupdir/$folder/$folder..." +echo "Rotating $backupdir/$folder/$folder..." >> $log +rotate $backupdir/$folder/$folder $keep +info "Wget'ing $SECTION on $backupdir/$folder/$folder.0..." + +if [ ! -z "$badnwidth" ]; then + limit_rate="--limit-rate=$badnwidth""k" +fi + +cd $backupdir/$folder/$folder.0 +wget $wget_options $limit-rate -r -c -N -e robots=off $url +cd - + +$touch $backupdir/$folder/$folder.0 + +# remount backup destination as read-only + +if [ "$read_only" == "1" ] || [ "$read_only" == "yes" ]; then + mount -o remount,ro $mountpoint +fi + +# check partition for errors + +if [ "$fscheck" == "1" ] || [ "$fscheck" == "yes" ]; then + umount $mountpoint + if (($?)); then + warning "Could not umount $mountpoint to run fsck" + else + $nice $fsck -v -y $partition >> $log + mount $mountpoint + fi +fi + +# removes the lockfile + +if [ ! -z "$lockfile" ]; then + $rm $lockfile || warning "Could not remove lockfile $lockfile" +fi + +echo "Finnishing backup at `date`" >> $log + diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..a5897de --- /dev/null +++ b/install-sh @@ -0,0 +1,519 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-12-25.00 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/lib/Makefile.am b/lib/Makefile.am new file mode 100644 index 0000000..11eba37 --- /dev/null +++ b/lib/Makefile.am @@ -0,0 +1,29 @@ +pkglib_SCRIPTS = easydialog parseini tools vserver + +CLEANFILES = $(pkglib_SCRIPTS) + +EXTRA_DIST = easydialog.in parseini.in tools.in vserver.in + +edit = sed \ + -e "s,@CFGDIR\@,$(CFGDIR),g" \ + -e "s,@BASH\@,$(BASH),g" \ + -e "s,@AWK\@,$(AWK),g" \ + -e "s,@SED\@,$(SED),g" \ + -e "s,@MKTEMP\@,$(MKTEMP),g" \ + -e "s,@libdir\@,$(pkglibdir),g" + +easydialog: $(srcdir)/easydialog.in + rm -f easydialog + $(edit) easydialog.in > easydialog + +parseini: $(srcdir)/parseini.in + rm -f parseini + $(edit) parseini.in > parseini + +tools: $(srcdir)/tools.in + rm -f tools + $(edit) tools.in > tools + +vserver: $(srcdir)/vserver.in + rm -f vserver + $(edit) vserver.in > vserver diff --git a/lib/Makefile.in b/lib/Makefile.in new file mode 100644 index 0000000..e22f8fe --- /dev/null +++ b/lib/Makefile.in @@ -0,0 +1,336 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = lib +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(pkglib_SCRIPTS) +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASH = @BASH@ +CFGDIR = @CFGDIR@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +HAVE_RPM = @HAVE_RPM@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKTEMP = @MKTEMP@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_cv_have_rpm = @ac_cv_have_rpm@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +pkglib_SCRIPTS = easydialog parseini tools vserver +CLEANFILES = $(pkglib_SCRIPTS) +EXTRA_DIST = easydialog.in parseini.in tools.in vserver.in +edit = sed \ + -e "s,@CFGDIR\@,$(CFGDIR),g" \ + -e "s,@BASH\@,$(BASH),g" \ + -e "s,@AWK\@,$(AWK),g" \ + -e "s,@SED\@,$(SED),g" \ + -e "s,@MKTEMP\@,$(MKTEMP),g" \ + -e "s,@libdir\@,$(pkglibdir),g" + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibSCRIPTS: $(pkglib_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(pkglibSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(pkglibSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-pkglibSCRIPTS + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkglibSCRIPTS + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkglibSCRIPTS install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ + uninstall-am uninstall-pkglibSCRIPTS + + +easydialog: $(srcdir)/easydialog.in + rm -f easydialog + $(edit) easydialog.in > easydialog + +parseini: $(srcdir)/parseini.in + rm -f parseini + $(edit) parseini.in > parseini + +tools: $(srcdir)/tools.in + rm -f tools + $(edit) tools.in > tools + +vserver: $(srcdir)/vserver.in + rm -f vserver + $(edit) vserver.in > vserver +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/lib/easydialog.in b/lib/easydialog.in new file mode 100644 index 0000000..056c76c --- /dev/null +++ b/lib/easydialog.in @@ -0,0 +1,267 @@ +#!@BASH@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- + +# copyright 2002 lmoore@tump.com under the terms of the GNU LGPL. +# additions 2005 collective@riseup.net + +# whiptail has trouble being called in the foo=$(whiptail ...) fashion for +# some reason. this is very annoying. this means that we need to use +# temporary files to store the answers from the input and list based boxes +# and then read the answers into a REPLY variable. that just really +# stinks, oh well, that's what you get when you have a weak link +# implementation... +# +# inputBox and passwordBox could be refactored to use a common function + +test -z "$WIDTH" && WIDTH=0 +test -z "$HEIGHT" && HEIGHT=0 +BACKTITLE="" +DIALOG=dialog +HELP= + +setApplicationTitle() { + BACKTITLE=$* +} + +setHelp() { + HELP="$@" +} + +setDimension() { + WIDTH=$1 + HEIGHT=$2 +} + +booleanBox() { + $DIALOG --backtitle "$BACKTITLE" --title "$1" \ + `[ "$3" == no ] && echo '--defaultno'` --yesno "$2" $HEIGHT $WIDTH +} + +msgBox() { + $DIALOG --backtitle "$BACKTITLE" --title "$1" \ + --msgbox "$2" $HEIGHT $WIDTH +} + +gaugeBox() { + $DIALOG --backtitle "$BACKTITLE" --title "$1" \ + --gauge "$2" $HEIGHT $WIDTH 0 +} + +inputBox() { + local temp=$(@MKTEMP@ -t backupninja.XXXXXX) || exit 1 + trap "rm -f $temp" 0 + REPLY= + $DIALOG --backtitle "$BACKTITLE" --title "$1" \ + --inputbox "$2" $HEIGHT $WIDTH "$3" 2> $temp + local status=$? + [ $status = 0 ] && REPLY=$(cat $temp) + rm -f $temp + return $status +} + +# Xdialog and {dialog,whiptail} use different mechanism to "qoute" the +# values from a checklist. {dialog,whiptail} uses standard double quoting +# while Xdialog uses a "/" as the separator. the slash is arguably better, +# but the double quoting is more standard. anyway, this function can be +# overridden to allow a derived implementation to change it's quoting +# mechanism to the standard double-quoting one. it receives two +# arguements, the file that has the data and the box type. +_listReplyHook() { + cat $1 +} + +# this is the base implementation of all the list based boxes, it works +# out nicely that way. the real function just passes it's arguments to +# this function with an extra argument specifying the actual box that +# needs to be rendered. +_genericListBox() { + local box=$1 + shift 1 + local title=$1 + local text=$2 + shift 2 + local temp=$(@MKTEMP@ -t backupninja.XXXXXX) || exit 1 + trap "rm -f $temp" 0 + REPLY= + $DIALOG $HELP $_DEFAULT --backtitle "$BACKTITLE" --title "$title" \ + $box "$text" $HEIGHT $WIDTH 10 \ + "$@" 2> $temp + local status=$? + [ $status = 0 ] && REPLY=$(_listReplyHook $temp $box) + rm -f $temp + _DEFAULT= + return $status +} + +setDefault() { + _DEFAULT="--default-item $1" +} + +menuBox() { + _genericListBox --menu "$@" +} + +## a menu box with additional help info displayed +## at the bottom of the window when an item is selected +menuBoxHelp() { + HELP="--item-help" + _genericListBox --menu "$@" + status=$? + HELP= + return $status +} + +## a menu box with an addition button 'help' +menuBoxHelpFile() { + HELP="--help-button" + _genericListBox --menu "$@" + status=$? + HELP= + return $status +} + +checkBox() { + _genericListBox --checklist "$@" +} + +radioBox() { + _genericListBox --radiolist "$@" +} + +textBox() { + $DIALOG --backtitle "$BACKTITLE" --title "$1" --textbox "$2" $HEIGHT $WIDTH +} + +passwordBox() { + local temp=$(@MKTEMP@ -t backupninja.XXXXXX) || exit 1 + trap "rm -f $temp" 0 + REPLY= + $DIALOG --backtitle "$BACKTITLE" --title "$1" \ + --passwordbox "$2" $HEIGHT $WIDTH 2> $temp + local status=$? + [ $status = 0 ] && REPLY=$(cat $temp) + rm -f $temp + return $status +} + + +######################################################### +## begin-item-display style lists +## +## these lists are built by calling fuctions multiple times. +## this can make it easier to build your list in a loop +## + +listBegin() { + _menu_title=$1 + _menu_msg=$2 + _menu_items=0 + _menu_text= + _menu_labels= + _menu_status= +} + +listItem() { + _menu_labels[$_menu_items]=$1 + _menu_text[$_menu_items]=$2 + _menu_status[$_menu_items]=$3 # available only for checklist + let "_menu_items += 1" +} + + +## +## takes one of: +## menu, checklist, radiolist +## +listDisplay() { + boxtype=$1 + local temp=$(@MKTEMP@ -t backupninja.XXXXXX) || exit 1 + trap "rm -f $temp" 0 + + local label + local text + local status + ( + echo -ne " $HELP $_DEFAULT " + echo -ne " --backtitle '$BACKTITLE' " + echo -ne " --title '$_menu_title' " + echo -ne " --$boxtype '$_menu_msg' " + echo -ne " $HEIGHT $WIDTH 10 " + for ((i=0; i < $_menu_items ; i++)); do + label=${_menu_labels[$i]} + text=${_menu_text[$i]} + status=${_menu_status[$i]} + echo -ne " $label '$text' $status " + done + ) | xargs $DIALOG 2> $temp + + local status=$? + REPLY="" + [ $status = 0 ] && REPLY=`cat $temp` + rm -f $temp + _DEFAULT= + return $status +} + +#################################################### +## FORM + +_form_gap=2 +formBegin() { + _form_title=$1 + _form_items=0 + _form_labels= + _form_text= +} + +formItem() { + _form_labels[$_form_items]=$1 + _form_text[$_form_items]=$2 + let "_form_items += 1" +} + +formDisplay() { + local temp=$(@MKTEMP@ -t backupninja.XXXXXX) || exit 1 + + max_length=0 + for ((i=0; i < ${#_form_labels[@]} ; i++)); do + label=${_form_labels[$i]} + length=`expr length $label` + if [ $length -gt $max_length ]; then + max_length=$length + fi + done + let "max_length += 2" + + local xpos=1 + ( + echo -n -e "--form '$_form_title' 0 0 20" + for ((i=0; i < $_form_items ; i++)); do + label=${_form_labels[$i]} + text=${_form_text[$i]} + echo -n -e " $label $xpos 1 '$text' $xpos $max_length 30 30" + let "xpos += _form_gap" + done + ) | xargs $DIALOG 2> $temp + local status=$? + + ## + ## the exit status is meaningless, it is always 0. + ## i can't figure out how to get the exit status of dialog + ## if we do "dialog `arg code`" or "dialog $args", then the quotes + ## get messed up and dialog won't run. + ## if we do "(arg code) | xargs dialog", then the exit status is + ## swallowed by xargs. xargs should return different exit status + ## depending on the exit status of the command run, but i have + ## never been able to get that to work. + ## + + REPLY= + if [ $status = 0 ]; then + IFS=$'' + REPLY=`cat $temp` + IFS=$' \t\n' + fi + rm -f $temp + return $status +} diff --git a/lib/parseini.in b/lib/parseini.in new file mode 100644 index 0000000..2f2124c --- /dev/null +++ b/lib/parseini.in @@ -0,0 +1,130 @@ +# -*- mode: awk; indent-tabs-mode: nil; -*- +# +# parseini --- parses 'ini' style configuration files. +# +# Usage: +# awk -f parseini S=
P= +# +# if section is an empty string, then we use the default section +# +# example ini file: +# +# fruit = apple +# fruit = pear +# multiline = this is a multiline \ +# parameter +# +# # this is a comment +# [colors] +# red = yes +# green = no +# blue = maybe +# +# [ocean] +# fish = red +# fish = blue +# +# example usage: +# > awk -f parseini S=ocean P=fish testfile.ini +# would return: +# red +# blue +# + +BEGIN { + readlines = 1 + implied = 1 +} + +# remove lines starting with #, but not #! +/^#[^!]/ {next} + +# skip blank +/^[ \r\t]*$/ {next} + +# we want to read the lines of the matched section +# and disable for other sections +/^\[.+\][ \r\t]*$/ { + continueline = 0 + if (S && implied) { + nline = 0 + implied = 0 + } + if (S && match($0, "^\\[" S "\\][ \n]*")) { + # we found the section, so start reading. + readlines = 1 + } + else { + # no section, so stop reading lines + if (readlines) readlines = 0 + } + next +} + +# when reading, store lines. + +{ + if (!readlines) next + line[nline++] = $0 + if ($0 ~ /\\[ \r\t]*$/) + continueline = 1 + else + continueline = 0 +} + +# process the read lines lines, matching parameters + +END { + # if section is set but implied is still true + # then we never found the section, so use everything + if (S && implied) { + nline = 0 + } + + # if have P then find P in read lines and get values + if (P) { + MATCH = "^[ \r\t]*" P "[ \r\t]*=" + continueline = 0 + for (x = 0; x < nline; ++x) { + v = line[x] + if (continueline) { + sub(/[ \r\t]+$/, "", v) + if (v ~ /\\$/) { + v = substr(v, 1, length(v)-1) + sub(/[ \r\t]+$/, "", v) + } + if (v) value[nvalue++] = v + } + else if (v ~ MATCH) { + sub(MATCH, "", v) + sub(/^[ \r\t]+/, "", v) + sub(/[ \r\t]+$/, "", v) + if (v ~ /\\$/) { + continueline = 1 + v = substr(v, 1, length(v)-1) + sub(/[ \r\t]+$/, "", v) + } + if (v) value[nvalue++] = v + } + } + # copy parameter definition to output array + nline = nvalue + for (x = 0; x < nvalue; ++x) + line[x] = value[x] + } + + # trim all leading & trailing whitespace; + # except for leading whitespace in continuation lines, + + for (x = 0; x < nline; ++x) { + sub(/^[ \r\t]+/, "", line[x]) + sub(/[ \r\t]+$/, "", line[x]) + } + + # output the final result + for (x = 0; x < nline; ++x) + print line[x] + + if (nline) exit 0 + else exit 1 +} diff --git a/lib/tools.in b/lib/tools.in new file mode 100644 index 0000000..0005be9 --- /dev/null +++ b/lib/tools.in @@ -0,0 +1,48 @@ +#!@BASH@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- + +# This file contains functions shared between ninjahelper and backupninja. + +##################################################### +## MISC FUNCTIONS + +# +# create a temporary file in a secure way. +# +function maketemp() { + local tempfile=`mktemp /tmp/$1.XXXXXXXX` + echo $tempfile +} + +##################################################### +## CONFIG-FILE RELATED FUNCTIONS + +function setfile() { + CURRENT_CONF_FILE=$1 +} + +function setsection() { + CURRENT_SECTION=$1 +} + +# +# sets a global var with name equal to $1 +# to the value of the configuration parameter $1 +# $2 is the default. +# +function getconf() { + CURRENT_PARAM=$1 + ret=`@AWK@ -f $libdirectory/parseini S=$CURRENT_SECTION P=$CURRENT_PARAM $CURRENT_CONF_FILE` + # if nothing is returned, set the default + if [ "$ret" == "" -a "$2" != "" ]; then + ret="$2" + fi + + # replace * with %, so that it is not globbed. + ret="${ret//\\*/__star__}" + + # this is weird, but single quotes are needed to + # allow for returned values with spaces. $ret is still expanded + # because it is in an 'eval' statement. + eval $1='$ret' +} diff --git a/lib/vserver.in b/lib/vserver.in new file mode 100644 index 0000000..153a9b0 --- /dev/null +++ b/lib/vserver.in @@ -0,0 +1,250 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- + +##################################################### +## VSERVERS RELATED FUNCTIONS FOR NINJAHELPER +## +## Depends on: +## - easydialog library +## - $conffile +## +## Global variables used and modified here: +## - $vservers_are_available (yes/no) +## - $found_vservers (list) +## - $selected_vservers (list) +## - $host_or_vservers (host/vservers/both) +## + +## +## Get vservers-related variables. +## Then, if Vservers are enabled, check that: +## - VROOTDIR is valid; +## - at least one vserver can be found. +## If, and only if, the above conditions are all true: +## - set $vservers_are_available to 'yes'; +## - set $found_vservers to the list of all vservers found on the system. +## This function has to be run once before a new helper is run. +## If the argument is "nodialog", use the backupninja's message functions +## instead of easydialog. +## +init_vservers() { + local arg=$1 + # get global variables from the conffile + setfile $conffile + getconf vservers no + getconf VSERVERINFO /usr/sbin/vserver-info + getconf VSERVER /usr/sbin/vserver + getconf VROOTDIR `if [ -x "$VSERVERINFO" ]; then $VSERVERINFO info SYSINFO | grep '^ *vserver-Rootdir' | @AWK@ '{print $2}'; fi` + # canonicalize VROOTDIR + [ -z "$VROOTDIR" ] || VROOTDIR=`readlink --canonicalize $VROOTDIR` + # init this library's global variables + vservers_are_available=no + found_vservers= + selected_vservers= + host_or_vservers=host + # check vservers real availability + if [ $vservers = yes ]; then + if [ ! -x "$VSERVERINFO" ]; then + `if [ "$arg" = nodialog ]; then echo fatal; else echo "msgBox warning"; fi` \ + "vservers enabled in $conffile, but vserver-info command was not found. Please set the VSERVERINFO configuration variable to its full path." + return + fi + if [ ! -x "$VSERVER" ]; then + `if [ "$arg" = nodialog ]; then echo fatal; else echo "msgBox warning"; fi` \ + "vservers enabled in $conffile, but vserver command was not found. Please set the VSERVER configuration variable to its full path." + return + fi + if [ -z "$VROOTDIR" ]; then + `if [ "$arg" = nodialog ]; then echo fatal; else echo "msgBox warning"; fi` \ + "vservers enabled in $conffile, but VROOTDIR is not set and could not be guessed." + return + fi + if [ ! -d "$VROOTDIR" ]; then + `if [ "$arg" = nodialog ]; then echo fatal; else echo "msgBox warning"; fi` \ + "vservers enabled in $conffile, but VROOTDIR ($VROOTDIR) does not exist."; + return + fi + found_vservers=`ls $VROOTDIR | grep -E -v "lost\+found|ARCHIVES" | tr "\n" " "` + if [ -z "$found_vservers" ]; then + `if [ "$arg" = nodialog ]; then echo warning; else echo "msgBox warning"; fi` \ + "vservers enabled in $conffile, but no vserver was found in $VROOTDIR."; + return + fi + vservers_are_available=yes + fi +} + +## +## If all the arguments are existing vservers names, returns 0. +## Else, returns 1. Also returns 1 if no argument is given. +## +vservers_exist() { + [ $# -ge 1 ] || return 1 + local args="$1" + local vserver i found + for vserver in $args ; do + found=no + for i in $found_vservers ; do + if [ $vserver = $i ]; then + found=yes + break + fi + done + [ $found = yes ] || return 1 + done + return 0 +} + +## +## If all the arguments are running vservers names, returns 0. +## Else, returns 1. Also returns 1 if no argument is given. +## +vservers_running() { + [ $# -ge 1 ] || return 1 + local args="$1" + local vserver + for vserver in $args ; do + $VSERVERINFO -q $vserver RUNNING || return 1 + done + return 0 +} + +## +## If the argument is the name of a vserver selected by the current helper, +## echoes 'on' and returns 0. +## Else, echoes 'off' and returns 1. +## +vserver_is_selected() { + local vserver=$1 + local vserver_is_selected=1 + local i + for i in $selected_vservers ; do + [ "$vserver" == "$i" ] && vserver_is_selected=0 + done + if [ $vserver_is_selected = 0 ]; then + echo on + else + echo off + fi + return $vserver_is_selected +} + +## +## Have the user choose one Vserver among the existing ones. +## Set $selected_vservers to the chosen one's name. +## Returns 1 if cancelled or if Vservers are not available. +## +choose_one_vserver() { + [ "$vservers_are_available" == "yes" ] || return 1 + local title=$1 + local i= + local vserver= + REPLY= + while [ -z "$REPLY" ]; do + [ -n "$selected_vservers" ] && setDefault $selected_vservers + listBegin "$title" "Choose at least one Linux-Vserver to backup:" + for vserver in $found_vservers; do + listItem "$vserver" "Backup $vserver vserver" + done + listDisplay menu + [ $? = 0 ] || return 1 + done + selected_vservers=$REPLY +} + +## +## If Vservers are not enabled, set host_or_vservers='host' and then return +## Else, have the user choose if he/she wants to perform the backup on the host +## system or on one Vserver. +## Set, respectively, $host_or_vservers to 'host' or 'vservers'. +## Returns 1 if cancelled. +## +choose_host_or_one_vserver() { + if [ "$vservers_are_available" != "yes" ] + then + host_or_vservers='host' + return + fi + local title=$1 + # if there is one, set the previously chosen item as the default + [ -n "$host_or_vservers" ] && setDefault $host_or_vservers + menuBox "$title - src" "Do you want to operate on the host system and/or on vservers?" \ + "host" "Host system" \ + "vserver" "One Vserver" + [ $? = 0 ] || return 1 + case $REPLY in + "host") + host_or_vservers='host' + ;; + "vserver") + host_or_vservers='vservers' + ;; + esac +} + +## +## If Vservers are not enabled, set host_or_vservers='host' and then return +## Else, have the user choose the target he/she wants to perform the backup on: +## - host system only; +## - some vservers only; +## - both the host system and some vservers. +## Set, respectively, $host_or_vservers to 'host', 'vservers', or 'both' +## Returns 1 if cancelled. +## +choose_host_or_vservers_or_both() { + if [ "$vservers_are_available" != "yes" ] + then + host_or_vservers='host' + return + fi + local title=$1 + # if there is one, set the previously chosen item as the default + [ -n "$host_or_vservers" ] && setDefault $host_or_vservers + menuBox "$title - src" "Do you want to operate on the host system and/or on vservers?" \ + "host" "Host system only" \ + "vservers" "Vservers only" \ + "both" "Host system and Vservers" + [ $? = 0 ] || return 1 + case $REPLY in + "host") + host_or_vservers='host' + ;; + "vservers") + host_or_vservers='vservers' + ;; + "both") + host_or_vservers='both' + ;; + esac +} + +## +## Have the user choose among "all vservers" and a not-empty subset of these. +## Set $selected_vservers to 'all' or to a space-separated name list. +## Returns 1 if cancelled or if Vservers are not available. +## +choose_one_or_more_vservers() { + [ "$vservers_are_available" == "yes" ] || return 1 + local title=$1 + local i= + # UI + booleanBox "$title" "Do you want to backup all vservers?" ` [ -z "$selected_vservers" -o "$selected_vservers" == "all" ] || echo no` + if [ $? = 0 ]; then + selected_vservers="all" + else + # choose among the existing vservers + local vserver= + local vserver_was_selected= + REPLY= + while [ -z "$REPLY" ]; do + listBegin "$title" "Choose at least one Linux-Vserver to backup:" + # list existing vservers, preselecting the previously selected ones + for vserver in $found_vservers; do + listItem "$vserver" "Backup $vserver vserver" `vserver_is_selected $vserver` + done + listDisplay checklist + [ $? = 0 ] || return 1 + done + # remove quotes around each vserver name + selected_vservers=`echo $REPLY | tr -d '"'` + fi +} diff --git a/man/Makefile.am b/man/Makefile.am new file mode 100644 index 0000000..8800248 --- /dev/null +++ b/man/Makefile.am @@ -0,0 +1,6 @@ + + +man_MANS = backup.d.5 backupninja.conf.5 backupninja.1 ninjahelper.1 + +EXTRA_DIST = $(man_MANS) + diff --git a/man/Makefile.in b/man/Makefile.in new file mode 100644 index 0000000..87c4075 --- /dev/null +++ b/man/Makefile.in @@ -0,0 +1,385 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = man +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" +man5dir = $(mandir)/man5 +NROFF = nroff +MANS = $(man_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASH = @BASH@ +CFGDIR = @CFGDIR@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +HAVE_RPM = @HAVE_RPM@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKTEMP = @MKTEMP@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_cv_have_rpm = @ac_cv_have_rpm@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +man_MANS = backup.d.5 backupninja.conf.5 backupninja.1 ninjahelper.1 +EXTRA_DIST = $(man_MANS) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu man/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ + done +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ + done +install-man5: $(man5_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" + @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.5*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 5*) ;; \ + *) ext='5' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \ + done +uninstall-man5: + @$(NORMAL_UNINSTALL) + @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.5*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 5*) ;; \ + *) ext='5' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man5dir)/$$inst"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: install-man1 install-man5 + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-man + +uninstall-man: uninstall-man1 uninstall-man5 + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-man5 install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-man \ + uninstall-man1 uninstall-man5 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/man/backup.d.5 b/man/backup.d.5 new file mode 100644 index 0000000..5090051 --- /dev/null +++ b/man/backup.d.5 @@ -0,0 +1,106 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BACKUP.D 5 "October 10, 2005" "riseup" "backupninja package" +.SH NAME +BACKUP.D \- Action configuration files for \fBbackupninja(1)\fP. + +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.br +.SH SYNOPSIS +.B "/etc/backup.d/* " +.br +.SH DESCRIPTION + +To preform the actual backup actions, backupninja processes each action configuration file in +/etc/backup.d according to the file's suffix. + +.IP .sh 10 +run this file as a shell script. +.IP .rdiff +backup action for rdiff-backup. +.IP .dup +backup action for duplicity. +.IP .maildir +backup action for slow, incremental rsyncs of tens of thousands of maildirs. +.IP .mysql +backup action for safe MySQL dumps. +.IP .pgsql +backup action for safe PostgreSQL dumps. +.IP .ldap +backup action for safe OpenLdap dumps. +.IP .sys +backup action for general system reports and hardware information. +.IP .svn +backup action for safe backups of subversion repositories. +.IP .trac +backup action for safe backups of trac repositories. +.IP .makecd +backup action for burning backups to CD/DVD or creating ISOs. + +.TP +These files must be owned by root and must not be world or group readable/writable. Support for additional configuration types can be added by dropping bash scripts with the name of the suffix into /usr/share/backupninja. +.TP +The configuration files are processed in alphabetical order. However, it is suggested that you name the config files in "sysvinit style." +.TP +For example: + 10-local.ldap.disabled + 15-runthisfirst.sh + 20-runthisnext.mysql + 90-runthislast.rdiff +.TP +Typically, you will put a '.rdiff' config file last, so that any database dumps you make are included in the filesystem backup. Action configurations which end with .disabled are skipped. +.TP +Example templates for the action configuration files can be found in /usr/share/doc/backupninja/examples. You can also use \fBninjahelper(1)\fP, a console based "wizard" for creating backup actions. + +.SH SCHEDULING + +By default, each configuration file is processed everyday at 01:00 (1 AM). This can be changed by specifying the 'when' option in a backup action's config file or in the global configuration file. + +For example: + when = sundays at 02:00 + when = 30th at 22 + when = 30 at 22:00 + when = everyday at 01 + when = Tuesday at 05:00 + when = hourly + +These values for "when" are invalid: + when = tuesday at 2am + when = tuesday at 2 + when = tues at 02 + +A configuration file will be processed at the time(s) specified by the "when" option. If multiple "when" options are present, then they all apply. If two configurations files are scheduled to run in the same hour, then we fall back on the alphabetical ordering specified above. The "when" must occur before any sections in the action configuration file. + +.SH FILE FORMAT + +The file format of the action configuration files is "ini style." Sections are created by using square bracket. Long lines are connected with a backslash. For example: + + # this is a comment + [fishes] + fish = red + fish = blue + [fruit] + apple = yes + pear = no thanks \\ + i will not have a pear. + +.SH SEE ALSO +.BR backupninja (1), +.BR ninjahelper (1), +.BR backupninja.conf (5), +.br +.SH AUTHOR +BACKUPNINJA was written by the riseup.net collective. diff --git a/man/backupninja.1 b/man/backupninja.1 new file mode 100644 index 0000000..53b1e3c --- /dev/null +++ b/man/backupninja.1 @@ -0,0 +1,137 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BACKUPNINJA 1 "October 10, 2005" "riseup" "backupninja package" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +BACKUPNINJA \- A lightweight, extensible meta-backup system +.br +.I +"a silent flower blossom death strike to lost data." +.SH SYNOPSIS +.B "backupninja [ \-h ] [ \-d ] [ \-n ] [ \-t ] [ \-f filename ] [ \-\-run filename ]" +.br +.SH DESCRIPTION +.B Backupninja +allows you to coordinate system backups by dropping a few +simple configuration files into /etc/backup.d/. Most programs you +might use for making backups don't have their own configuration file +format. Backupninja provides a centralized way to configure and +coordinate many different backup utilities. +.PP + +.SH FEATURES +.IP - 2 +easy to read ini style configuration files. +.IP - +you can drop in scripts to handle new types of backups. +.IP - +backup actions can be scheduled. +.IP - +you can choose when status report emails are mailed to you (always, on warning, on error, never). +.IP - +console-based wizard (ninjahelper) makes it easy to create backup action configuration files. +.IP - +passwords are never sent via the command line to helper programs. +.IP - +in order to backup a db or sql database, you cannot simply copy database files. backupninja helps you safely export the data to a format which you can backup. +.IP - +works with Linux-Vservers. + +.B Backup types include: +.IP - 2 +secure, remote, incremental filesytem backup (via rdiff-backup). incremental data is compressed. permissions are retained even with an unpriviledged backup user. +.IP - +basic system and hardware information. +.IP - +encrypted remote backups (via duplicity). +.IP - +safe backup of MySQL, PostgreSQL, OpenLDAP, and subversion databases. +.IP - +burn CD/DVDs or create ISOs. + +.\" TeX users may be more comfortable with the \fB\fP and +.\" \fI\fP escape sequences to invoke bold face and italics, +.\" respectively. + +.SH OPTIONS +.TP +.B \-h, \-\-help +Show summary of options +.TP +.B \-d, \-\-debug +Run in debug mode, where all log messages are output to the current shell. +.TP +.B \-f, \-\-conffile CONF_FILE +Use CONF_FILE for the main configuration instead of /etc/backupninja.conf +.TP +.B \-t, \-\-test +Run in test mode, no actions are actually taken. +.TP +.B \-n, \-\-now +Perform actions now, instead of when they might be scheduled. +.TP +.B \-\-run ACTION_FILE +Runs the action configuration ACTION_FILE and exits. + +.SH CONFIGURATION + +General settings are configured in /etc/backupninja.conf. In this file you +can set the log level and change the default directory locations. See \fBbackupninja.conf(5)\fP. + +To preform the actual backup actions, backupninja processes each action configuration file in +/etc/backup.d according to the file's suffix. See \fBbackup.d(5)\fP. + +.SH EXAMPLE USAGE +.TP +Backupninja can be used to impliment whatever backup strategy you choose. It is intended, however, to be used like so: +.TP +First, databases are safely copied or exported to /var/backups. Often, you cannot make a file backup of a database while it is in use, hence the need to use special tools to make a safe copy or export into /var/backups. +.TP +Then, vital parts of the file system, including /var/backups, are nightly pushed to a remote, off-site, hard disk (using rdiff-backup). The local user is root, but the remote user is not privileged. Hopefully, the remote filesystem is encrypted. +.TP +In order for this to work (ie for diff-backup to run unattended), you must create ssh keys on the source server and copy the public key to the remote user's authorized keys file. For example: +.br +root@srchost# ssh-keygen -t dsa +.br +root@srchost# ssh-copy-id -i /root/.ssh/id_dsa.pub backup@desthost +.TP +Now, you should be able to ssh from user 'root' on srchost to user 'backup' on desthost without specifying a password. When prompted for a password by ssh-keygen, just leave it blank by hitting return. The "wizard" \fBninjahelper(1)\fP will walk you through these steps. + +.SH FILES +.PD 0 +\fB/usr/sbin/backupninja\fP main script +.br +\fB/etc/backupninja.conf\fP main configuration file; general options +.br +\fB/etc/cron.d/backupninja\fP runs main script hourly +.br +\fB/etc/logrotate.d/backupninja\fP rotates backupninja.log +.br +\fB/etc/backup.d\fP directory for configuration files +.br +\fB/usr/share/backupninja\fP directory for handler scripts +.br +\fB/usr/share/doc/backupninja/examples\fP example action configuration files. +.br +.PD + +.SH SEE ALSO +.BR ninjahelper (1), +.BR backupninja.conf (5), +.BR backup.d (5), +.br +.SH AUTHOR +BACKUPNINJA was written by the riseup.net collective. diff --git a/man/backupninja.conf.5 b/man/backupninja.conf.5 new file mode 100644 index 0000000..7911fdf --- /dev/null +++ b/man/backupninja.conf.5 @@ -0,0 +1,134 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BACKUPNINJA.CONF 5 "November 19, 2005" "riseup" "backupninja package" +.SH NAME +BACKUPNINJA.CONF \- Configuration file(s) for \fBbackupninja (1)\fP. + +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.br +.SH SYNOPSIS +.B "/etc/backupninja.conf " +.br +.SH DESCRIPTION +.B backupninja.conf +is the general configuration file. In this file you can set the log level and change the default directory locations. You can force a different general configuration file with "backupninja -f /path/to/conf". + +.SH OPTIONS + +.TP +.B loglevel +How verbose to make the logs. +.br +5 = Debugging messages +.br +4 = Informational messages +.br +3 = Warnings +.br +2 = Errors +.br +1 = Fatal errors + +.TP +.B reportemail +Send a summary of the backup status to this email address + +.TP +.B reportsuccess +If set to 'yes', a report email will be generated even if all modules reported success. + +.TP +.B reportwarning +If set to 'yes', a report email will be generated even if there was no error. + +.TP +.B logfile +The path of the logfile. + +.TP +.B configdirectory +The directory where all the backup action configuration files live. + +.TP +.B scriptdirectory +Where backupninja handler scripts are found + +.TP +.B usecolors +If set to 'yes', use colors in the log file and debug output. + +.TP +.B when +When to process each configuration file. The value used here will +be applied for each configuration file. It is possibile to override +this "when" in each each configuration file, see also section +"Scheduling" in backup.d(5). + +For example: + + when = sundays at 02:00 + when = 30th at 22 + when = 30 at 22:00 + when = everyday at 01 <-- the default + when = Tuesday at 05:00 + +These values for 'when' are equivalent: + + when = tuesday at 05:30 + when = TUESDAYS at 05 + +These values for 'when' are invalid: + + when = tuesday at 2am + when = tuesday at 2 + when = tues at 02 + +.TP +.B vservers +If you are using Linux-Vservers (http://linux-vserver.org), there are some +special capabilities that different handlers have to make vserver backups easier. +See the example configuration files for each handler to configure the vserver specific +variables. + +.SH DEFAULTS + +loglevel = 4 +.br +reportemail = root +.br +reportsuccess = yes +.br +reportwarning = yes +.br +logfile = /var/log/backupninja.log +.br +configdirectory = /etc/backup.d +.br +scriptdirectory = /usr/share/backupninja +.br +usecolors = yes +.br +when = everyday at 01:00 +.br +vservers = no + +.SH SEE ALSO +.BR backupninja (1), +.BR ninjahelper (1), +.BR backup.d (5), +.br +.SH AUTHOR +BACKUPNINJA was written by the riseup.net collective. diff --git a/man/ninjahelper.1 b/man/ninjahelper.1 new file mode 100644 index 0000000..34b1ce4 --- /dev/null +++ b/man/ninjahelper.1 @@ -0,0 +1,62 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH NINJAHELPER 1 "january 19, 2006" "riseup" "backupninja package" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +NINJAHELPER \- A menu driven curses-based interface to walk you through +backupninja configuration. +.br +.SH SYNOPSIS +.B "ninjahelper" +.br +.SH DESCRIPTION +.B Ninjahelper +is an helper script to walk you through configuration of the backup +tasks for backupninja. It is a curses based "wizard" with an intuitive +menu-driven interface. +.PP +.SH ADDING NEW HELPERS +.br +To add an additional 'wizard' to ninjahelper, follow these steps: +.IP (1) +create a file in the handlers directory (eg. /usr/share/backupninja) using +the .helper extention. For example, if you wish to create a helper for the +handler "blue", create the file /usr/share/backupninja/blue.helper. +.IP (2) +next, add your helper to the global HELPERS variable and define the main +function for your helper (the function name is always _wizard). To +use the blue.helper as an example: +HELPERS="$HELPERS blue:description_of_this_helper" + blue_wizard() { + ... do work here ... + } +.IP (3) +look at the existing helpers to see how they are written. Try to re-use +functions, such as the dialog functions that are defined in easydialog.sh, +or the vserver functions defined in lib/vserver. +.IP (4) +test, re-test, and test again. Try to break the helper by going backwards, +try to think like someone who has no idea how to configure your handler +would think, try to make your helper as simple as possible. Walk like a cat, +become your shadow, don't let your senses betray you. + +.SH SEE ALSO +.BR backupninja (1), +.BR backupninja.conf (5), +.BR backup.d (5), +.br +.SH AUTHOR +BACKUPNINJA was written by the riseup.net collective. diff --git a/missing b/missing new file mode 100755 index 0000000..1c8ff70 --- /dev/null +++ b/missing @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..3d5bdb8 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,34 @@ +# tyhle vygenerujeme ... +sbin_SCRIPTS = backupninja ninjahelper + +# a proto je taky musĂ­me smazat ... +CLEANFILES = $(sbin_SCRIPTS) + +EXTRA_DIST = backupninja.in ninjahelper.in ninjareport.in + +edit = sed \ + -e "s,@CFGDIR\@,$(CFGDIR),g" \ + -e "s,@BASH\@,$(BASH),g" \ + -e "s,@AWK\@,$(AWK),g" \ + -e "s,@SED\@,$(SED),g" \ + -e 's,@datadir\@,$(pkgdatadir),g' \ + -e "s,@libdir\@,$(pkglibdir),g" \ + -e 's,@localstatedir\@,$(localstatedir),g' \ + -e 's,@prefix\@,$(prefix),g' + +#install-exec-hook: + +backupninja: $(srcdir)/backupninja.in + rm -f backupninja + $(edit) $(srcdir)/backupninja.in > backupninja + chmod ugo+x backupninja + +ninjahelper: $(srcdir)/ninjahelper.in + rm -f ninjahelper + $(edit) $(srcdir)/ninjahelper.in > ninjahelper + chmod ugo+x ninjahelper + +ninjareport: $(srcdir)/ninjareport.in + rm -f ninjareport + $(edit) $(srcdir)/ninjareport.in > ninjareport + chmod ugo+x ninjareport diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..f0ee2db --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,343 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(sbindir)" +sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(sbin_SCRIPTS) +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASH = @BASH@ +CFGDIR = @CFGDIR@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +HAVE_RPM = @HAVE_RPM@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKTEMP = @MKTEMP@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_cv_have_rpm = @ac_cv_have_rpm@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# tyhle vygenerujeme ... +sbin_SCRIPTS = backupninja ninjahelper + +# a proto je taky musĂ­me smazat ... +CLEANFILES = $(sbin_SCRIPTS) +EXTRA_DIST = backupninja.in ninjahelper.in ninjareport.in +edit = sed \ + -e "s,@CFGDIR\@,$(CFGDIR),g" \ + -e "s,@BASH\@,$(BASH),g" \ + -e "s,@AWK\@,$(AWK),g" \ + -e "s,@SED\@,$(SED),g" \ + -e 's,@datadir\@,$(pkgdatadir),g' \ + -e "s,@libdir\@,$(pkglibdir),g" \ + -e 's,@localstatedir\@,$(localstatedir),g' \ + -e 's,@prefix\@,$(prefix),g' + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-sbinSCRIPTS: $(sbin_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" + @list='$(sbin_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(sbinSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ + $(sbinSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sbindir)/$$f"; \ + else :; fi; \ + done + +uninstall-sbinSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ + rm -f "$(DESTDIR)$(sbindir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(sbindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-sbinSCRIPTS + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-sbinSCRIPTS + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-sbinSCRIPTS install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ + uninstall-am uninstall-sbinSCRIPTS + + +#install-exec-hook: + +backupninja: $(srcdir)/backupninja.in + rm -f backupninja + $(edit) $(srcdir)/backupninja.in > backupninja + chmod ugo+x backupninja + +ninjahelper: $(srcdir)/ninjahelper.in + rm -f ninjahelper + $(edit) $(srcdir)/ninjahelper.in > ninjahelper + chmod ugo+x ninjahelper + +ninjareport: $(srcdir)/ninjareport.in + rm -f ninjareport + $(edit) $(srcdir)/ninjareport.in > ninjareport + chmod ugo+x ninjareport +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/backupninja.in b/src/backupninja.in new file mode 100755 index 0000000..afb9556 --- /dev/null +++ b/src/backupninja.in @@ -0,0 +1,583 @@ +#!@BASH@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- +# +# |\_ +# B A C K U P N I N J A /()/ +# `\| +# +# Copyright (C) 2004-05 riseup.net -- property is theft. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +##################################################### +## FUNCTIONS + +function setupcolors () { + BLUE="\033[34;01m" + GREEN="\033[32;01m" + YELLOW="\033[33;01m" + PURPLE="\033[35;01m" + RED="\033[31;01m" + OFF="\033[0m" + CYAN="\033[36;01m" + COLORS=($BLUE $GREEN $YELLOW $RED $PURPLE $CYAN) +} + +function colorize () { + if [ "$usecolors" == "yes" ]; then + local typestr=`echo "$@" | @SED@ 's/\(^[^:]*\).*$/\1/'` + [ "$typestr" == "Debug" ] && type=0 + [ "$typestr" == "Info" ] && type=1 + [ "$typestr" == "Warning" ] && type=2 + [ "$typestr" == "Error" ] && type=3 + [ "$typestr" == "Fatal" ] && type=4 + [ "$typestr" == "Halt" ] && type=5 + color=${COLORS[$type]} + endcolor=$OFF + echo -e "$color$@$endcolor" + else + echo -e "$@" + fi +} + +# We have the following message levels: +# 0 - debug - blue +# 1 - normal messages - green +# 2 - warnings - yellow +# 3 - errors - red +# 4 - fatal - purple +# 5 - halt - cyan +# First variable passed is the error level, all others are printed + +# if 1, echo out all warnings, errors, or fatal +# used to capture output from handlers +echo_debug_msg=0 + +usecolors=yes + +function printmsg() { + [ ${#@} -gt 1 ] || return + + type=$1 + shift + if [ $type == 100 ]; then + typestr=`echo "$@" | @SED@ 's/\(^[^:]*\).*$/\1/'` + [ "$typestr" == "Debug" ] && type=0 + [ "$typestr" == "Info" ] && type=1 + [ "$typestr" == "Warning" ] && type=2 + [ "$typestr" == "Error" ] && type=3 + [ "$typestr" == "Fatal" ] && type=4 + [ "$typestr" == "Halt" ] && type=5 + typestr="" + else + types=(Debug Info Warning Error Fatal Halt) + typestr="${types[$type]}: " + fi + + print=$[4-type] + + if [ $echo_debug_msg == 1 ]; then + echo -e "$typestr$@" >&2 + elif [ $debug ]; then + colorize "$typestr$@" >&2 + fi + + if [ $print -lt $loglevel ]; then + logmsg "$typestr$@" + fi +} + +function logmsg() { + if [ -w "$logfile" ]; then + echo -e `date "+%h %d %H:%M:%S"` "$@" >> $logfile + fi +} + +function passthru() { + printmsg 100 "$@" +} +function debug() { + printmsg 0 "$@" +} +function info() { + printmsg 1 "$@" +} +function warning() { + printmsg 2 "$@" +} +function error() { + printmsg 3 "$@" +} +function fatal() { + printmsg 4 "$@" + exit 2 +} +function halt() { + printmsg 5 "$@" + exit 2 +} + +msgcount=0 +function msg { + messages[$msgcount]=$1 + let "msgcount += 1" +} + +# +# enforces very strict permissions on configuration file $file. +# + +function check_perms() { + local file=$1 + debug "check_perms $file" + local perms + local owners + + perms=($(stat -L --format='%A' $file)) + debug "perms: $perms" + local gperm=${perms:4:3} + debug "gperm: $gperm" + local wperm=${perms:7:3} + debug "wperm: $wperm" + + owners=($(stat -L --format='%g %G %u %U' $file)) + local gid=${owners[0]} + local group=${owners[1]} + local owner=${owners[2]} + + if [ "$owner" != 0 ]; then + echo "Configuration files must be owned by root! Dying on file $file" + fatal "Configuration files must be owned by root! Dying on file $file" + fi + + if [ "$wperm" != '---' ]; then + echo "Configuration files must not be world writable/readable! Dying on file $file" + fatal "Configuration files must not be world writable/readable! Dying on file $file" + fi + + if [ "$gperm" != '---' ]; then + case "$admingroup" in + $gid|$group) :;; + + *) + if [ "$gid" != 0 ]; then + echo "Configuration files must not be writable/readable by group $group! Use the admingroup option in backupninja.conf. Dying on file $file" + fatal "Configuration files must not be writable/readable by group $group! Use the admingroup option in backupninja.conf. Dying on file $file" + fi + ;; + esac + fi +} + +# simple lowercase function +function tolower() { + echo "$1" | tr '[:upper:]' '[:lower:]' +} + +# simple to integer function +function toint() { + echo "$1" | tr -d '[:alpha:]' +} + +# +# function isnow(): returns 1 if the time/day passed as $1 matches +# the current time/day. +# +# format is at