From 4a4231dda8fcb20278a62963a85bf85d67c1e849 Mon Sep 17 00:00:00 2001 From: Brian Read Date: Wed, 12 Jul 2023 08:54:20 +0100 Subject: [PATCH] initial commit of file from CVS for e-smith-flexbackup on Wed 12 Jul 08:54:20 BST 2023 --- .gitignore | 4 + Makefile | 21 + README.md | 18 +- additional/COPYING | 340 +++++++++++++++ additional/e-smith-flexbackup.spec | 279 ++++++++++++ contriborbase | 1 + createlinks | 35 ++ e-smith-flexbackup.spec | 402 ++++++++++++++++++ .../defaults/flexbackup/Blocksize | 1 + .../defaults/flexbackup/BufferMegs | 1 + .../defaults/flexbackup/BufferProg | 1 + .../defaults/flexbackup/TapeBlocksize | 1 + .../db/configuration/defaults/flexbackup/Type | 1 + .../defaults/flexbackup/erase_rewind_only | 1 + .../db/configuration/defaults/flexbackup/type | 1 + .../events/actions/tape-backup-flexbackup | 4 + .../events/actions/tape-restore-flexbackup | 327 ++++++++++++++ .../events/bootstrap-console-save/.gitignore | 0 .../etc/e-smith/events/conf-backup/.gitignore | 0 .../e-smith/events/console-save/.gitignore | 0 .../e-smith/events/restore-tape/.gitignore | 0 .../etc/flexbackup.conf/10AfioParams | 15 + .../templates/etc/flexbackup.conf/10Blocksize | 13 + .../templates/etc/flexbackup.conf/10Buffering | 5 + .../etc/flexbackup.conf/10Compression | 4 + .../etc/flexbackup.conf/10CpioParams | 6 + .../templates/etc/flexbackup.conf/10Device | 11 + .../etc/flexbackup.conf/10DumpParams | 11 + .../etc/flexbackup.conf/10EraseRewindOnly | 6 + .../etc/flexbackup.conf/10EraseTapeAllZero | 4 + .../etc/flexbackup.conf/10Exclude_expr00 | 8 + .../templates/etc/flexbackup.conf/10Globals | 9 + .../templates/etc/flexbackup.conf/10Logging | 16 + .../templates/etc/flexbackup.conf/10MtTell | 5 + .../etc/flexbackup.conf/10NoCompressTypes00 | 4 + .../templates/etc/flexbackup.conf/10TarParams | 9 + .../etc/flexbackup.conf/10Traverse_fs | 4 + .../templates/etc/flexbackup.conf/10ZipParams | 4 + .../etc/flexbackup.conf/10filesystems | 31 ++ .../etc/flexbackup.conf/10prune_tree | 10 + .../templates/etc/flexbackup.conf/10type | 4 + 41 files changed, 1615 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 additional/COPYING create mode 100644 additional/e-smith-flexbackup.spec create mode 100644 contriborbase create mode 100644 createlinks create mode 100644 e-smith-flexbackup.spec create mode 100644 root/etc/e-smith/db/configuration/defaults/flexbackup/Blocksize create mode 100644 root/etc/e-smith/db/configuration/defaults/flexbackup/BufferMegs create mode 100644 root/etc/e-smith/db/configuration/defaults/flexbackup/BufferProg create mode 100644 root/etc/e-smith/db/configuration/defaults/flexbackup/TapeBlocksize create mode 100644 root/etc/e-smith/db/configuration/defaults/flexbackup/Type create mode 100644 root/etc/e-smith/db/configuration/defaults/flexbackup/erase_rewind_only create mode 100644 root/etc/e-smith/db/configuration/defaults/flexbackup/type create mode 100644 root/etc/e-smith/events/actions/tape-backup-flexbackup create mode 100644 root/etc/e-smith/events/actions/tape-restore-flexbackup create mode 100644 root/etc/e-smith/events/bootstrap-console-save/.gitignore create mode 100644 root/etc/e-smith/events/conf-backup/.gitignore create mode 100644 root/etc/e-smith/events/console-save/.gitignore create mode 100644 root/etc/e-smith/events/restore-tape/.gitignore create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10AfioParams create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10Blocksize create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10Buffering create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10Compression create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10CpioParams create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10Device create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10DumpParams create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10EraseRewindOnly create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10EraseTapeAllZero create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10Exclude_expr00 create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10Globals create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10Logging create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10MtTell create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10NoCompressTypes00 create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10TarParams create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10Traverse_fs create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10ZipParams create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10filesystems create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10prune_tree create mode 100644 root/etc/e-smith/templates/etc/flexbackup.conf/10type diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e594810 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.rpm +*.log +*spec-20* +*.tar.xz diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8aff836 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: e-smith-flexbackup +# $Id: Makefile,v 1.1 2016/02/05 23:03:03 stephdl Exp $ +NAME := e-smith-flexbackup +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attept a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/README.md b/README.md index fc19b1a..2a20082 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ -# e-smith-flexbackup +# e-smith-flexbackup -SMEServer Koozali developed git repo for e-smith-flexbackup smeserver \ No newline at end of file +SMEServer Koozali developed git repo for e-smith-flexbackup smeserver + +## Wiki +
https://wiki.koozali.org/ + +## Bugzilla +Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=e-smith-flexbackup&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED) + +## Description + +
*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.* +*Once it has been checked, then this comment will be deleted* +
+ +e-smith-FlexBackup is a powerful and versatile software solution for managing and backing up important data. It provides a comprehensive set of tools for creating backups, scheduling them, and restoring them when necessary. It also offers a rich set of features to help users customize their backup policies and even automate them. With these features, users can easily manage multiple backups, set up scheduled backups, and monitor the status of their backups. Best of all, the e-smith-FlexBackup software is available for free, making it accessible to everyone. diff --git a/additional/COPYING b/additional/COPYING new file mode 100644 index 0000000..eeb586b --- /dev/null +++ b/additional/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) 19yy + + 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) 19yy 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/additional/e-smith-flexbackup.spec b/additional/e-smith-flexbackup.spec new file mode 100644 index 0000000..e3c394a --- /dev/null +++ b/additional/e-smith-flexbackup.spec @@ -0,0 +1,279 @@ +Summary: Adds daily flexbackup backup to tape to e-smith +%define name e-smith-flexbackup +Name: %{name} +%define version 1.9.0 +%define release 01 +Version: %{version} +Release: %{release} +License: GPL +Group: Networking/Daemons +Source: %{name}-%{version}.tar.gz +Packager: e-smith developers +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot +BuildArchitectures: noarch +Requires: e-smith-base, flexbackup, dump +Requires: e-smith-backup >= 1.11.0-46 +AutoReqProv: no + +%description +This package configures flexbackup and sets up a daily cron job +to run a backup to tape. + +%changelog +* Sun Jan 16 2005 Charlie Brady +- [1.9.0-01] +- Changing version to development stream number - 1.9.0 + +* Thu Jun 26 2003 Charlie Brady +- [1.8.0-01] +- Changing version to stable stream number to 1.8.0 + +* Thu Jun 19 2003 Charlie Brady +- [1.7.1-07] +- Enable buffering using "buffer" rather than "mbuffer". [charlieb 9053] + +* Wed Jun 18 2003 Charlie Brady +- [1.7.1-06] +- Autodetect tar/dump at restore time and DTRT. [charlieb 8965] +- Disable buffering during restore. [charlieb 9053] + +* Thu Jun 12 2003 Charlie Brady +- [1.7.1-05] +- Change default backup type from dump to tar. Allow override from config + db. [charlieb 8965] + +* Thu Jun 12 2003 Charlie Brady +- [1.7.1-04] +- Fix quoting error in 10Blocksize fragment, and split concepts of blocking + for archive and blocking for tape drive, as latest flexbackup has done. + [charlieb 9014] + +* Thu Jun 12 2003 Charlie Brady +- [1.7.1-03] +- Add tape-backup-flexbackup action, which will be used by + /sbin/e-smith/do_backup harness. Remove remnant of templated backup + program. [charlieb 7853] +- Set $verbose to false, so we don't get list of all files as we backup. + [charlieb 8965] + +* Thu Jun 12 2003 Charlie Brady +- [1.7.1-02] +- Port configuration to newest version of flexbackup. [charlieb 9014] +- s/Copyright/License/. + +* Thu Jun 12 2003 Charlie Brady +- [1.7.1-01] +- Roll new development stream to 1.7.1 + +* Thu Jun 12 2003 Charlie Brady +- [1.7.0-04] +- Allow blocksize to be controlled by a db parameter. [charlieb 9017] + +* Fri May 16 2003 Gordon Rowell +- [1.7.0-03] +- Modified tape-restore-flexbackup to use esmith::Backup library [gordonr 8766] + +* Wed Apr 16 2003 Tony Clayton +- [1.7.0-02] +- Skip loopback filesystems during backup [tonyc 7749] + +* Wed Nov 6 2002 Charlie Brady +- [1.7.0-01] +- Rolling development stream version to 1.7.0 + +* Fri Oct 11 2002 Charlie Brady +- [1.6.0-01] +- Roll to maintained version number to 1.6.0 + +* Fri Oct 11 2002 Charlie Brady +- [1.6.0-01] +- Roll to maintained version number to 1.6.0 + +* Fri Aug 9 2002 Charlie Brady +- [1.5.2-01] +- Redo last fix, something's awry with my pattern match, so we'll use a + pair of eqs instead. [charlieb 4588] + +* Fri Aug 9 2002 Charlie Brady +- [1.5.1-01] +- Change fstab grok in flexbackup.conf template to handle ext3 file + systems. [charlieb 4588] + +* Wed Jun 5 2002 Charlie Brady +- [1.5.0-01] +- Changing version to maintained stream number to 1.5.0 + +* Fri May 31 2002 Charlie Brady +- [1.4.0-01] +- Changing version to maintained stream number to 1.4.0 +- Remove bogus "/sbin/console" reference in copyright notice in + tape restore script. + +* Thu May 23 2002 Gordon Rowell +- [1.3.3-01] +- RPM rebuild forced by cvsroot2rpm + +* Sun Mar 17 2002 Charlie Brady +- [1.3.2-01] +- Restore /root rather than just /root/.ssh. [charlieb #2322] + +* Sun Mar 17 2002 Charlie Brady +- [1.3.1-01] +- Test build to verify CVS conversion. + +* Sun Mar 17 2002 Charlie Brady +- [1.3.0-01] +- rollRPM: Rolled version number to 1.3.0-01. Includes patches up to 1.2.0-08. +- Add mkdir command to create event directories to %pre section, in preparation + for CVS conversion. +- Remove obsolete %post script. + +* Fri Nov 02 2001 Charlie Brady +- [1.2.0-08] +- Remove all comments from /etc/flexbackup.conf + +* Fri Aug 17 2001 gordonr +- [1.2.0-07] +- Autorebuild by rebuildRPM + +* Fri Jul 6 2001 Peter Samuel +- [1.2.0-06] +- Changed license to GPL + +* Mon Feb 12 2001 Adrian Chung +- [1.2.0-05] +- rolling release number for GPG signing. + +* Sun Feb 11 2001 Charlie Brady +- [1.2.0-04] +- Include etc/e-smith/templates-user-custom in restore fileset. + +* Thu Feb 8 2001 Adrian Chung +- Rolling release number for GPG signing. + +* Thu Feb 8 2001 Peter Samuel +- [1.2.0-02] +- Using correct path for /flexbackup.extract.log in email messages. + +* Thu Jan 25 2001 Peter Samuel +- [1.2.0-01] +- Rolled version number to 1.2.0-01. Includes patches upto 1.1.0-10. + +* Wed Jan 24 2001 Peter Samuel +- [1.1.0-10] +- Removed duplicated filesystem code from 10Compression template fragment + +* Tue Jan 23 2001 Peter Samuel +- [1.1.0-09] +- Forced padding of blocks when writing to tapes + +* Sat Jan 13 2001 Peter Samuel +- [1.1.0-08] +- revised order of files to restore - doesn't really make any + difference, but it keeps it consistent with e-smith-backup + +- [1.1.0-07] +- added missing use esmith::db to tape-restore-flexbackup + +* Sat Jan 13 2001 Peter Samuel +- [1.1.0-06] +- tape-restore-flexbackup now send mail to admin on success or failure + +* Fri Jan 12 2001 Peter Samuel +- [1.1.0-05] +- Added flexbackup specific tape-restore program (ripped out of + e-smith-backup). +- Removes /etc/cron.d/flexbackup as part of bootstrap-console-save +- Createlinks is now a perl program. + +* Fri Jan 12 2001 Charlie Brady +- [1.1.0-4] +- Fix silly syntax errors in template +- Migrate old flexbackup service entry to new. + +* Fri Jan 12 2001 Charlie Brady +- [1.1.0-3] +- Make e-smith-flexbackup a subpackage of e-smith-backup +- Provide a template fragment for /sbin/e-smith/backup +- Use Device property of backup service. +- Mark flexbackup as a backupservice, not a service. +- Add link into bootstrap-console-save and conf-backup events + +* Thu Jan 11 2001 Peter Samuel +- [1.1.0-02] +- Ensured that /sbin is included in $PATH for flexbackup cron job + +* Tue Jan 9 2001 Peter Samuel +- [1.1.0-01] +- Rolled version number to 1.1.0-01. Includes patches upto 0.1-11 + +* Mon Jan 8 2001 Peter Samuel +- [0.1-11] +- Cron job now rewinds the tape after the backup + +* Sat Jan 6 2001 Jason Miller +- [0.1-9] +- updated /etc/cron.d/flexbackup template and the conf-flexbackup + actions to include new configuration database parameters + of backupTime and reminderTime + +* Sat Jan 6 2001 Charlie Brady +- [0.1-8] +- Only run %post sript when in runlevel 7 + +* Wed Jan 3 2001 Peter Samuel +- [0.1-7] +- Added use esmith::db to /etc/cron.d/flexbackup template + +* Wed Dec 27 2000 Peter Samuel +- [0.1-6] +- Crontab entry now uses mt to check for presence of tape before + running flexbackup. +- A reminder is mailed to root if there is no tape in the drive at 2pm. + +* Thu Dec 14 2000 Charlie Brady +- Move crontab entry to /etc/cron.d +- Make device and erase_backup_only configurable. +- make this a service in the configuration db, by default service is + disabled. + +* Tue Dec 12 2000 Charlie Brady +- Make flexbackup.conf a directory template +- Tweak a few settings - see patch for details. + +* Mon May 22 2000 Charlie Brady +- Generate file system list from /etc/fstab +- Fix missing %conf declaration in action script + +* Mon May 22 2000 Charlie Brady +- Fix spec file to include all relevant files +- Fix post script : cron -> crond + +* Sun May 14 2000 Charlie Brady +- Initial build + +%prep +%setup +mkdir -p root/etc/e-smith/events/restore-tape +mkdir -p root/etc/e-smith/events/console-save +mkdir -p root/etc/e-smith/events/conf-backup +mkdir -p root/etc/e-smith/events/bootstrap-console-save + +%build +perl createlinks + +%install +rm -rf $RPM_BUILD_ROOT +(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) +rm -f %{name}-%{version}-%{release}-filelist +/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ + > %{name}-%{version}-%{release}-filelist +echo "%doc COPYING" >> %{name}-%{version}-%{release}-filelist + +%post + +%clean +rm -rf $RPM_BUILD_ROOT + +%files -f %{name}-%{version}-%{release}-filelist +%defattr(-,root,root) diff --git a/contriborbase b/contriborbase new file mode 100644 index 0000000..ef36a67 --- /dev/null +++ b/contriborbase @@ -0,0 +1 @@ +sme10 diff --git a/createlinks b/createlinks new file mode 100644 index 0000000..6e7de98 --- /dev/null +++ b/createlinks @@ -0,0 +1,35 @@ +#!/usr/bin/perl -w + +use esmith::Build::CreateLinks qw(:all); + +#-------------------------------------------------- +# functions for bootstrap-console-save event +#-------------------------------------------------- + +my $event = "bootstrap-console-save"; + +templates2events("/etc/flexbackup.conf", $event); + +#-------------------------------------------------- +# functions for conf-backup +#-------------------------------------------------- + +$event = "conf-backup"; + +templates2events("/etc/flexbackup.conf", $event); + +#-------------------------------------------------- +# functions for restore-tape +#-------------------------------------------------- + +$event = "restore-tape"; + +event_link("tape-restore-flexbackup", $event, "10"); + +#-------------------------------------------------- +# functions for e-smith-flexbackup-updat +#-------------------------------------------------- +$event="e-smith-flexbackup-update"; +templates2events("/etc/flexbackup.conf", $event); +# systemd-specific action mandatory for this package-update event + diff --git a/e-smith-flexbackup.spec b/e-smith-flexbackup.spec new file mode 100644 index 0000000..2f2eb6d --- /dev/null +++ b/e-smith-flexbackup.spec @@ -0,0 +1,402 @@ +# $Id: e-smith-flexbackup.spec,v 1.3 2021/01/06 19:30:57 jpp Exp $ + +Summary: Adds daily flexbackup backup to tape to e-smith +%define name e-smith-flexbackup +Name: %{name} +%define version 2.6.0 +%define release 4 +Version: %{version} +Release: %{release}%{?dist} +License: GPL +Group: Networking/Daemons +Source: %{name}-%{version}.tar.xz +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot +BuildArchitectures: noarch +Requires: e-smith-base, flexbackup, dump +Requires: buffer +Requires: mbuffer +Requires: tar +Requires: gzip +Requires: e-smith-backup >= 1.11.0-46 +Requires: e-smith-lib >= 1.15.1-19 +BuildRequires: e-smith-devtools >= 1.13.1-03 +AutoReqProv: no + +%description +This package configures flexbackup and sets up a daily cron job +to run a backup to tape. + +%changelog +* Wed Jul 12 2023 cvs2git.sh aka Brian Read 2.6.0-4.sme +- Roll up patches and move to git repo [SME: 12338] + +* Wed Jul 12 2023 BogusDateBot +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday. + Sat Dec 25 2005 --> Sat Dec 24 2005 or Sun Dec 25 2005 or Sat Dec 31 2005 or .... + +* Wed Jan 06 2021 Jean-Philipe Pialasse 2.6.0-3.sme +- add update event [SME: 11134] + +* Sat Dec 26 2020 John Crisp 2.6.0-2.sme +- Add XFS support - thanks to John Bennett [SME: 11292] + +* Sat Feb 06 2016 stephane de Labrusse 2.6.0-1.sme +- Initial release to sme10 + +* Sat Oct 19 2013 John H. Bennett III 2.4.0-3.sme +- Patch to exclude trying to backup aquota.* files so that backups to tape will [SME: 7918] + +* Mon Oct 07 2013 John H. Bennett III 2.4.0-2.sme +- Simple patch to add support for ext4 file system so default SME9 file systems + can be backed up to tape. [SME: 7824] + +* Wed Feb 13 2013 Shad L. Lords 2.4.0-1.sme +- Roll new stream for sme9 + +* Tue Oct 7 2008 Shad L. Lords 2.2.0-1.sme +- Roll new stream to separate sme7/sme8 trees [SME: 4633] + +* Sun Apr 29 2007 Shad L. Lords +- Clean up spec so package can be built by koji/plague + +* Thu Dec 07 2006 Shad L. Lords +- Update to new release naming. No functional changes. +- Make Packager generic + +* Thu Apr 20 2006 Charlie Brady 1.10.0-02 +- Remove redundant "mt fsf" from DetermineBlocksize(). [SME: 1191] + +* Wed Mar 15 2006 Charlie Brady 1.10.0-01 +- Roll stable stream version. [SME: 1016] + +* Mon Jan 23 2006 Charlie Brady 1.9.0-18 +- Fix spelling of blksize parameter when running flexbackup to restore. + [SME: 375] + +* Sun Jan 22 2006 Charlie Brady 1.9.0-17 +- Fix some perl warnings from last change. [SME: 375] + +* Sun Jan 8 2006 Charlie Brady 1.9.0-16 +- Autodetect tape block size and use that when extracting files, rather + that what is in flexbackup.conf [SME: 375] + +* Sun Dec 25 2005 Gordon Rowell 1.9.0-15 + Sat Dec 25 2005 --> Sat Dec 24 2005 or Sun Dec 25 2005 or Sat Dec 31 2005 or .... +- Avoid the use of mt tell - use mt status instead [SME: 320] + +* Sat Dec 17 2005 Charlie Brady 1.9.0-14 +- Remove attempted autdetection of backup type, since it doesn't + work. [SME: 340] + +* Wed Nov 30 2005 Gordon Rowell 1.9.0-13 +- Bump release number only + +* Sun Nov 20 2005 Gordon Rowell +- [1.9.0-12] +- Output nothing (not '0') when there is no prune list [SF: 1360696] + +* Thu Oct 20 2005 Charlie Brady +- [1.9.0-11] +- Allow a Prune property to specify a list of subtrees which are + not included in the backup. [SF: 1332834] + +* Thu Oct 20 2005 Charlie Brady +- [1.9.0-10] +- Don't bother to backup /boot partition, as we never restore it + anyway. We expect it all to be installed via CDROM or as part of + an upgrade. [SF: 1332834] + +* Tue Aug 9 2005 Charlie Brady +- [1.9.0-09] +- Make buffer program to use configurable via a db property - + default to 'buffer'. +- Add Requires: mbuffer [SF: 1252345] + +* Tue Jul 19 2005 Charlie Brady +- [1.9.0-08] +- Update to current db access APIs. [SF: 1216546] + +* Thu Jun 2 2005 Charlie Brady +- [1.9.0-07] +- Fix missing semi-colon on erase_rewind_only line in conf. + [SF: 1192822,1213076] +- Adjust some default params. [SF: 1213076] + +* Sat Apr 30 2005 Charlie Brady +- [1.9.0-06] +- Fix quoting of erase_rewind_only value [SF: 1192822] + +* Mon Mar 14 2005 Charlie Brady +- [1.9.0-05] +- Fix stray } in 10EraseRwindOnly template fragment (introduced in last + change set). + +* Mon Mar 14 2005 Charlie Brady +- [1.9.0-04] +- Use generic_template_expand action in place of conf-flexbackup. + Add default db property fragments. Update e-smith-lib dependency. [MN00064130] +- Simplify flexbackup.conf template, and remove anachronisms. + +* Fri Jan 28 2005 Charlie Brady +- [1.9.0-03] +- Remove dangling clobber-flexbackup-cron symlink. [MN00065727] + +* Tue Jan 25 2005 Charlie Brady +- [1.9.0-02] +- Remove obsolete clobber-flexbackup-cron action. [MN00065727] + +* Sun Jan 16 2005 Charlie Brady +- [1.9.0-01] +- Changing version to development stream number - 1.9.0 + +* Thu Jun 26 2003 Charlie Brady +- [1.8.0-01] +- Changing version to stable stream number to 1.8.0 + +* Thu Jun 19 2003 Charlie Brady +- [1.7.1-07] +- Enable buffering using "buffer" rather than "mbuffer". [charlieb 9053] + +* Wed Jun 18 2003 Charlie Brady +- [1.7.1-06] +- Autodetect tar/dump at restore time and DTRT. [charlieb 8965] +- Disable buffering during restore. [charlieb 9053] + +* Thu Jun 12 2003 Charlie Brady +- [1.7.1-05] +- Change default backup type from dump to tar. Allow override from config + db. [charlieb 8965] + +* Thu Jun 12 2003 Charlie Brady +- [1.7.1-04] +- Fix quoting error in 10Blocksize fragment, and split concepts of blocking + for archive and blocking for tape drive, as latest flexbackup has done. + [charlieb 9014] + +* Thu Jun 12 2003 Charlie Brady +- [1.7.1-03] +- Add tape-backup-flexbackup action, which will be used by + /sbin/e-smith/do_backup harness. Remove remnant of templated backup + program. [charlieb 7853] +- Set $verbose to false, so we don't get list of all files as we backup. + [charlieb 8965] + +* Thu Jun 12 2003 Charlie Brady +- [1.7.1-02] +- Port configuration to newest version of flexbackup. [charlieb 9014] +- s/Copyright/License/. + +* Thu Jun 12 2003 Charlie Brady +- [1.7.1-01] +- Roll new development stream to 1.7.1 + +* Thu Jun 12 2003 Charlie Brady +- [1.7.0-04] +- Allow blocksize to be controlled by a db parameter. [charlieb 9017] + +* Fri May 16 2003 Gordon Rowell +- [1.7.0-03] +- Modified tape-restore-flexbackup to use esmith::Backup library [gordonr 8766] + +* Wed Apr 16 2003 Tony Clayton +- [1.7.0-02] +- Skip loopback filesystems during backup [tonyc 7749] + +* Wed Nov 6 2002 Charlie Brady +- [1.7.0-01] +- Rolling development stream version to 1.7.0 + +* Fri Oct 11 2002 Charlie Brady +- [1.6.0-01] +- Roll to maintained version number to 1.6.0 + +* Fri Oct 11 2002 Charlie Brady +- [1.6.0-01] +- Roll to maintained version number to 1.6.0 + +* Fri Aug 9 2002 Charlie Brady +- [1.5.2-01] +- Redo last fix, something's awry with my pattern match, so we'll use a + pair of eqs instead. [charlieb 4588] + +* Fri Aug 9 2002 Charlie Brady +- [1.5.1-01] +- Change fstab grok in flexbackup.conf template to handle ext3 file + systems. [charlieb 4588] + +* Wed Jun 5 2002 Charlie Brady +- [1.5.0-01] +- Changing version to maintained stream number to 1.5.0 + +* Fri May 31 2002 Charlie Brady +- [1.4.0-01] +- Changing version to maintained stream number to 1.4.0 +- Remove bogus "/sbin/console" reference in copyright notice in + tape restore script. + +* Thu May 23 2002 Gordon Rowell +- [1.3.3-01] +- RPM rebuild forced by cvsroot2rpm + +* Sun Mar 17 2002 Charlie Brady +- [1.3.2-01] +- Restore /root rather than just /root/.ssh. [charlieb #2322] + +* Sun Mar 17 2002 Charlie Brady +- [1.3.1-01] +- Test build to verify CVS conversion. + +* Sun Mar 17 2002 Charlie Brady +- [1.3.0-01] +- rollRPM: Rolled version number to 1.3.0-01. Includes patches up to 1.2.0-08. +- Add mkdir command to create event directories to %pre section, in preparation + for CVS conversion. +- Remove obsolete %post script. + +* Fri Nov 02 2001 Charlie Brady +- [1.2.0-08] +- Remove all comments from /etc/flexbackup.conf + +* Fri Aug 17 2001 gordonr +- [1.2.0-07] +- Autorebuild by rebuildRPM + +* Fri Jul 6 2001 Peter Samuel +- [1.2.0-06] +- Changed license to GPL + +* Mon Feb 12 2001 Adrian Chung +- [1.2.0-05] +- rolling release number for GPG signing. + +* Sun Feb 11 2001 Charlie Brady +- [1.2.0-04] +- Include etc/e-smith/templates-user-custom in restore fileset. + +* Thu Feb 8 2001 Adrian Chung +- Rolling release number for GPG signing. + +* Thu Feb 8 2001 Peter Samuel +- [1.2.0-02] +- Using correct path for /flexbackup.extract.log in email messages. + +* Thu Jan 25 2001 Peter Samuel +- [1.2.0-01] +- Rolled version number to 1.2.0-01. Includes patches upto 1.1.0-10. + +* Wed Jan 24 2001 Peter Samuel +- [1.1.0-10] +- Removed duplicated filesystem code from 10Compression template fragment + +* Tue Jan 23 2001 Peter Samuel +- [1.1.0-09] +- Forced padding of blocks when writing to tapes + +* Sat Jan 13 2001 Peter Samuel +- [1.1.0-08] +- revised order of files to restore - doesn't really make any + difference, but it keeps it consistent with e-smith-backup + +- [1.1.0-07] +- added missing use esmith::db to tape-restore-flexbackup + +* Sat Jan 13 2001 Peter Samuel +- [1.1.0-06] +- tape-restore-flexbackup now send mail to admin on success or failure + +* Fri Jan 12 2001 Peter Samuel +- [1.1.0-05] +- Added flexbackup specific tape-restore program (ripped out of + e-smith-backup). +- Removes /etc/cron.d/flexbackup as part of bootstrap-console-save +- Createlinks is now a perl program. + +* Fri Jan 12 2001 Charlie Brady +- [1.1.0-4] +- Fix silly syntax errors in template +- Migrate old flexbackup service entry to new. + +* Fri Jan 12 2001 Charlie Brady +- [1.1.0-3] +- Make e-smith-flexbackup a subpackage of e-smith-backup +- Provide a template fragment for /sbin/e-smith/backup +- Use Device property of backup service. +- Mark flexbackup as a backupservice, not a service. +- Add link into bootstrap-console-save and conf-backup events + +* Thu Jan 11 2001 Peter Samuel +- [1.1.0-02] +- Ensured that /sbin is included in $PATH for flexbackup cron job + +* Tue Jan 9 2001 Peter Samuel +- [1.1.0-01] +- Rolled version number to 1.1.0-01. Includes patches upto 0.1-11 + +* Mon Jan 8 2001 Peter Samuel +- [0.1-11] +- Cron job now rewinds the tape after the backup + +* Sat Jan 6 2001 Jason Miller +- [0.1-9] +- updated /etc/cron.d/flexbackup template and the conf-flexbackup + actions to include new configuration database parameters + of backupTime and reminderTime + +* Sat Jan 6 2001 Charlie Brady +- [0.1-8] +- Only run %post sript when in runlevel 7 + +* Wed Jan 3 2001 Peter Samuel +- [0.1-7] +- Added use esmith::db to /etc/cron.d/flexbackup template + +* Wed Dec 27 2000 Peter Samuel +- [0.1-6] +- Crontab entry now uses mt to check for presence of tape before + running flexbackup. +- A reminder is mailed to root if there is no tape in the drive at 2pm. + +* Thu Dec 14 2000 Charlie Brady +- Move crontab entry to /etc/cron.d +- Make device and erase_backup_only configurable. +- make this a service in the configuration db, by default service is + disabled. + +* Tue Dec 12 2000 Charlie Brady +- Make flexbackup.conf a directory template +- Tweak a few settings - see patch for details. + +* Mon May 22 2000 Charlie Brady +- Generate file system list from /etc/fstab +- Fix missing %conf declaration in action script + +* Mon May 22 2000 Charlie Brady +- Fix spec file to include all relevant files +- Fix post script : cron -> crond + +* Sun May 14 2000 Charlie Brady +- Initial build + +%prep +%setup + +%build +perl createlinks + +%install +rm -rf $RPM_BUILD_ROOT +(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) +rm -f %{name}-%{version}-%{release}-filelist +/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ + > %{name}-%{version}-%{release}-filelist +echo "%doc COPYING" >> %{name}-%{version}-%{release}-filelist + +%post +rm -f /etc/cron.d/flexbackup + +%clean +rm -rf $RPM_BUILD_ROOT + +%files -f %{name}-%{version}-%{release}-filelist +%defattr(-,root,root) diff --git a/root/etc/e-smith/db/configuration/defaults/flexbackup/Blocksize b/root/etc/e-smith/db/configuration/defaults/flexbackup/Blocksize new file mode 100644 index 0000000..f5c8955 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/flexbackup/Blocksize @@ -0,0 +1 @@ +32 diff --git a/root/etc/e-smith/db/configuration/defaults/flexbackup/BufferMegs b/root/etc/e-smith/db/configuration/defaults/flexbackup/BufferMegs new file mode 100644 index 0000000..209e3ef --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/flexbackup/BufferMegs @@ -0,0 +1 @@ +20 diff --git a/root/etc/e-smith/db/configuration/defaults/flexbackup/BufferProg b/root/etc/e-smith/db/configuration/defaults/flexbackup/BufferProg new file mode 100644 index 0000000..1a28c91 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/flexbackup/BufferProg @@ -0,0 +1 @@ +buffer diff --git a/root/etc/e-smith/db/configuration/defaults/flexbackup/TapeBlocksize b/root/etc/e-smith/db/configuration/defaults/flexbackup/TapeBlocksize new file mode 100644 index 0000000..573541a --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/flexbackup/TapeBlocksize @@ -0,0 +1 @@ +0 diff --git a/root/etc/e-smith/db/configuration/defaults/flexbackup/Type b/root/etc/e-smith/db/configuration/defaults/flexbackup/Type new file mode 100644 index 0000000..42f2fb7 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/flexbackup/Type @@ -0,0 +1 @@ +tar diff --git a/root/etc/e-smith/db/configuration/defaults/flexbackup/erase_rewind_only b/root/etc/e-smith/db/configuration/defaults/flexbackup/erase_rewind_only new file mode 100644 index 0000000..27ba77d --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/flexbackup/erase_rewind_only @@ -0,0 +1 @@ +true diff --git a/root/etc/e-smith/db/configuration/defaults/flexbackup/type b/root/etc/e-smith/db/configuration/defaults/flexbackup/type new file mode 100644 index 0000000..54ae0c7 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/flexbackup/type @@ -0,0 +1 @@ +backupservice diff --git a/root/etc/e-smith/events/actions/tape-backup-flexbackup b/root/etc/e-smith/events/actions/tape-backup-flexbackup new file mode 100644 index 0000000..1cc5d7f --- /dev/null +++ b/root/etc/e-smith/events/actions/tape-backup-flexbackup @@ -0,0 +1,4 @@ +#! /bin/sh + +cd / +exec /usr/bin/flexbackup -set all -noreten diff --git a/root/etc/e-smith/events/actions/tape-restore-flexbackup b/root/etc/e-smith/events/actions/tape-restore-flexbackup new file mode 100644 index 0000000..4cdbcef --- /dev/null +++ b/root/etc/e-smith/events/actions/tape-restore-flexbackup @@ -0,0 +1,327 @@ +#!/usr/bin/perl -w + +#---------------------------------------------------------------------- +# copyright (C) 1999-2005 Mitel Networks Corporation +# +# 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 +# +#---------------------------------------------------------------------- +# Restore e-smith config etc from tape using flexbackup + +package esmith; +use esmith::ConfigDB; +use esmith::Backup; +use strict; + +my $conf = esmith::ConfigDB->open_ro or die "Could not open config db"; + +my $backup_program = $conf->get('backup')->prop('Program'); + +unless (defined $backup_program && $backup_program eq 'flexbackup') +{ + exit(0); +} + +package main; + +########################################################################### + +use POSIX; +use English; +use strict; + +my $configfile = "/etc/flexbackup.conf"; +my $filesystem = "/"; +my $tempfile = "/tmp/restore.$$"; + +my $backup = new esmith::Backup or die "Couldn't create Backup object\n"; + +my @restore = $backup->restore_list; + +package cfg; +require $configfile; +@cfg::filesystems = split(/ /, $cfg::set{full}); +package main; + +sub FindTapeFile ($); +sub ProbeTape ($); +sub RewindTape ($); +sub FSFTape ($$); +sub DetermineBlocksize($); +sub CreateFileList($); +sub ExtractFiles($$$); +sub NotifyAdmin ($$); +sub DetermineBackupType; + +unless (defined @cfg::filesystems && @cfg::filesystems) +{ + my $message = << "EOF"; +An error occurred while restoring from tape. + +As there were no filesystems listed for backup in /etc/flexbackup.conf +the correct dump file on the tape could not be located. +EOF + + NotifyAdmin("Tape restore failed", $message); + + die "Tape restore failed: no filesystems listed for backup" + . " in $cfg::filesystems.\n"; +} + +my $tapefile = &FindTapeFile($filesystem); +++$tapefile; # Skip the index file + +&ProbeTape($cfg::device); +&RewindTape($cfg::device); +&FSFTape($cfg::device, $tapefile); +my $tape_blocksize = &DetermineBlocksize($cfg::device); +&RewindTape($cfg::device); +&FSFTape($cfg::device, $tapefile); +&CreateFileList($tempfile); +&ExtractFiles($filesystem, $tempfile, $tape_blocksize); + +########################################################################### + +sub FindTapeFile ($) +{ + # Need to locate which file on the tape contains the dump of the + # root filesystem. Assume it is a one tape archive for the moment. + + my $filesystem = shift; + + foreach (@cfg::filesystems) + { + if (m:\W*$filesystem\W*:) + { + my @fs = split(/\s+/, $_); + + for (my $i = 0; $i < @fs; $i++) + { + return $i if ($fs[$i] eq "$filesystem") + } + } + + my $message = << "EOF"; +An error occurred while restoring from tape. + +The $filesystem filesystem is not listed on the first tape. +EOF + + NotifyAdmin("Tape restore failed", $message); + + die "Tape restore failed: $filesystem filesystem is not listed" + . " on the first tape.\n"; + } +} + +sub ProbeTape ($) +{ + my $device = shift; + + system("/bin/mt -f $device status > /dev/null 2>&1"); + + if ($CHILD_ERROR) + { + + my $message = << "EOF"; +An error occurred while restoring from tape. + +No tape loaded at $device. +EOF + + NotifyAdmin("Tape restore failed", $message); + + die "Tape restore failed: no tape loaded at $device.\n"; + } +} + +sub RewindTape ($) +{ + my $device = shift; + + system("/bin/mt -f $device rewind > /dev/null 2>&1"); + + if ($CHILD_ERROR) + { + + my $message = << "EOF"; +An error occurred while restoring from tape. + +Could not rewind tape at $device. +EOF + + NotifyAdmin("Tape restore failed", $message); + + die "Tape restore failed: could not rewind tape at $device.\n"; + } +} + +sub FSFTape ($$) +{ + my $device = shift; + my $files = shift; + + system("/bin/mt -f $device fsf $files > /dev/null 2>&1"); + + if ($CHILD_ERROR) + { + + my $message = << "EOF"; +An error occurred while restoring from tape. + +Could not position tape at file $files at $device. +EOF + + NotifyAdmin("Tape restore failed", $message); + + die "Tape restore failed: could not position tape at $device.\n"; + } +} + +sub DetermineBlocksize($) +{ + my $device = shift; + use File::Temp 'tempdir'; + use File::stat; + + my $dir = File::Temp::tempdir( CLEANUP => 1 ); + my $file = "$dir/xx"; + + system("dd", "if=$device", "bs=1M", "count=1", "of=$file"); + + my $st = stat($file) or die "No $file: $!"; + return (($st->size)/1024); +} + +sub DetermineBackupType +{ + my $device = shift; + my $magic = `/usr/bin/file -sz $device 2>/dev/null`; + + return "tar" if ($magic =~ /tar archive/); + return "dump" if ($magic =~ /new-fs dump file/); + return undef; +} + +sub CreateFileList ($) +{ + my $file = shift; + + unless (open(FILE, "> $file")) + { + my $error = $!; + + my $message = << "EOF"; +An error occurred while restoring from tape. + +Could not open temporary file $file for writing: $!. +EOF + + NotifyAdmin("Tape restore failed", $message); + + die "Tape restore failed: Could not open temporary file" + . " $file for writing: $error\n"; + } + + foreach (@restore) + { + print FILE "$_\n"; + } + + close FILE; +} + +sub ExtractFiles ($$$) +{ + my $filesystem = shift; + my $filelist = shift; + my $blocksize = shift; + + unless (chdir $filesystem) + { + my $error = $!; + + my $message = << "EOF"; +An error occurred while restoring from tape. + +Could not change directories to $filesystem: $!. +EOF + + NotifyAdmin("Tape restore failed", $message); + + die "Tape restore failed: could not change directories" + . " to $filesystem. $error\n"; + } + + $ENV{'PATH'} = "/bin:/usr/bin:/sbin"; + + system( + "/usr/bin/flexbackup", + "-extract", + "-d", "blksize=$blocksize", + "-flist", + $filelist + ); + + if ($CHILD_ERROR) + { + + my $message = << "EOF"; +An error occurred while restoring from tape. + +Flexbackup returned with an error. For more details concerning this +error see: + + /var/log/messages + /flexbackup.extract.log +EOF + + NotifyAdmin("Tape restore failed", $message); + + die "Tape restore failed: flexbackup error.\n"; + } + + unlink $filelist; + + my $message = << "EOF"; +Restoring from tape was successful. + +For more details concerning this successful restore see: + + /var/log/messages + /flexbackup.extract.log +EOF + + NotifyAdmin("Tape restore succeeded", $message); +} + +sub NotifyAdmin ($$) +{ + my $subject = shift; + my $message = shift; + + open(DATEMAIL, "|-") + or exec qw(/var/qmail/bin/datemail -t); + + print DATEMAIL << "EOF"; +To: admin +Subject: $subject + +$message + +EOF + + close DATEMAIL; +} diff --git a/root/etc/e-smith/events/bootstrap-console-save/.gitignore b/root/etc/e-smith/events/bootstrap-console-save/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/e-smith/events/conf-backup/.gitignore b/root/etc/e-smith/events/conf-backup/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/e-smith/events/console-save/.gitignore b/root/etc/e-smith/events/console-save/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/e-smith/events/restore-tape/.gitignore b/root/etc/e-smith/events/restore-tape/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10AfioParams b/root/etc/e-smith/templates/etc/flexbackup.conf/10AfioParams new file mode 100644 index 0000000..ebcd34e --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10AfioParams @@ -0,0 +1,15 @@ +{ +# ---------------------------------------------------------------------- +# Parameters for 'afio' only + +# True to show block numbers} +$afio_echo_block = 'false'; +{ +# Files less than this size (kilobytes) won't be compressed} +$afio_compress_threshold = '3'; +{ +# Maximum amount of memory (megabytes) to use for temporary storage of +# compression results. If a compressed file is bigger than this, compression +# will have to run twice on the file (see manpage).} +$afio_compress_cache_size = '2'; + diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10Blocksize b/root/etc/e-smith/templates/etc/flexbackup.conf/10Blocksize new file mode 100644 index 0000000..3fdc972 --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10Blocksize @@ -0,0 +1,13 @@ +{ +# Block size (k) to use (default for most things is 10) +# mt_var_blksize says to use "variable" block size for the tape device +# (mt setblk 0) +# If false, will use the $blksize parameter above. All non-mt commands +# will still use $blksize regardless of this value. + my $blksize = $flexbackup{Blocksize} || '32'; + $OUT = '$blksize = "' . $blksize . '";'; + $OUT .= "\n"; + + my $mt_blksize = $flexbackup{TapeBlocksize} || '0'; + $OUT .= '$mt_blksize = "' . $mt_blksize . '";'; +} diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10Buffering b/root/etc/e-smith/templates/etc/flexbackup.conf/10Buffering new file mode 100644 index 0000000..fec742f --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10Buffering @@ -0,0 +1,5 @@ +{# Buffering} +$buffer = '{ $flexbackup{BufferProg} || 'buffer' }'; {# name of buffer program to help streaming} +$buffer_megs = '{ $flexbackup{BufferMegs} || '20' }'; {# buffer memory size (in megabytes)} +$pad_blocks = 'true'; {# true to pad blocks to blocksize} + diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10Compression b/root/etc/e-smith/templates/etc/flexbackup.conf/10Compression new file mode 100644 index 0000000..1244a50 --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10Compression @@ -0,0 +1,4 @@ +{# Compression} +$compress = 'gzip'; {# one of false/gzip/bzip2/compress/hardware} +$compr_level = '4'; {# compression level (1-9) (for gzip/bzip2/zip)} + diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10CpioParams b/root/etc/e-smith/templates/etc/flexbackup.conf/10CpioParams new file mode 100644 index 0000000..65e4379 --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10CpioParams @@ -0,0 +1,6 @@ +{# ---------------------------------------------------------------------- +# Parameters for 'cpio' only + +# Format of cpio archive} +$cpio_format = 'newc'; + diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10Device b/root/etc/e-smith/templates/etc/flexbackup.conf/10Device new file mode 100644 index 0000000..f9f41e9 --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10Device @@ -0,0 +1,11 @@ +{# Device to backup to - non-rewinding version please! +# +# Examples: +# Linux SCSI: /dev/nst0 Linux IDE: /dev/nht0 +# Linux ftape: /dev/nqft0 FreeBSD SCSI: /dev/nrsa0 +# +# If a directory, archive to files in that directory rather than a device +# + my $device = $backup{'Device'} || '/dev/nst0'; + $OUT .= "\$device = '$device';"; +} diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10DumpParams b/root/etc/e-smith/templates/etc/flexbackup.conf/10DumpParams new file mode 100644 index 0000000..865a3f2 --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10DumpParams @@ -0,0 +1,11 @@ +{# ---------------------------------------------------------------------- +# Parameters for 'dump' only + +# Estimated tape size (in kilobytes). This number doesn't really do much +# but help 'dump' get size estimates if set to zero uses 'dump -a'} +$dump_length = '0'; +{ +# True to use /etc/dumpdates (could mess things up if you dump subdirectories +# of mount points). False to use flexbackup's timestamps.} +$dump_use_dumpdates = 'false'; + diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10EraseRewindOnly b/root/etc/e-smith/templates/etc/flexbackup.conf/10EraseRewindOnly new file mode 100644 index 0000000..b8782cb --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10EraseRewindOnly @@ -0,0 +1,6 @@ +# Set this to "true" to make erase operations just rewind - not really +# call "mt erase". For some tape drives, erase takes hours rather +# than seconds. +$erase_rewind_only = '{ + $flexbackup{erase_rewind_only} || 'false' +}'; diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10EraseTapeAllZero b/root/etc/e-smith/templates/etc/flexbackup.conf/10EraseTapeAllZero new file mode 100644 index 0000000..a1c40cf --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10EraseTapeAllZero @@ -0,0 +1,4 @@ +{# If true (default), level zero "set" assumes you want to erase and use +# a new tape. If false, level zero "set" appends like all other backups} +$erase_tape_set_level_zero = 'true'; + diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10Exclude_expr00 b/root/etc/e-smith/templates/etc/flexbackup.conf/10Exclude_expr00 new file mode 100644 index 0000000..37844cc --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10Exclude_expr00 @@ -0,0 +1,8 @@ +{# Exclude files that match these *regular expressions* (not shell wildcards) +# from the backups (no affect on 'dump' archives). You can list more than one, +# just keep incrementing the index in the brackets for each. Also, strip off +# leading directories (the filesystem specs above or the "-fs" flag). +# Comment these out to exclude nothing.} +$exclude_expr[0] = 'news/articles'; +$exclude_expr[1] = '.*~$'; {#'# single quote so emacs font-lock is happy} +$exclude_expr[2] = './aquota.*'; diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10Globals b/root/etc/e-smith/templates/etc/flexbackup.conf/10Globals new file mode 100644 index 0000000..b742f60 --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10Globals @@ -0,0 +1,9 @@ +{# Other global flags} +$remoteshell = 'ssh'; {# command for remote shell (rsh/ssh/ssh2)} +$remoteuser = ''; {# secondary user name for remote shells (not set) } +$label = 'true'; {# store identifying label in archive } +$verbose = 'false'; {# echo each file? (for afio/tar/cpio/zip)} +$sparse = 'true'; {# handle sparse files (for afio/tar/cpio)} +$indexes = 'true'; {# false to turn off all table-of-contents support} +$atime_preserve = 'true'; {# preserve access time (if possible) during backup } +$staticfiles = 'false'; {# Use non-dated filename if backing up to file } diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10Logging b/root/etc/e-smith/templates/etc/flexbackup.conf/10Logging new file mode 100644 index 0000000..fe01b08 --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10Logging @@ -0,0 +1,16 @@ +{# ---------------------------------------------------------------------- +# Log/stamp files, path for temporary files +} +$staticlogs = "false"; {# use dated log files} +$logdir = "/var/log/flexbackup"; {# directory for log files} +$stampdir = "/var/state/flexbackup"; {# directory for backup timestamps} +$index = "$stampdir/index"; {# DB filename for tape indexes} +$comp_log = "gzip"; {# compress log? false/gzip/bzip2/compress} +$prefix = ""; {# log files will start with this prefix} +$sprefix = ""; {# stamp files will start with this prefix} +$tmpdir = "/tmp"; {# used for temporary refdate files, etc} +{ +# Why do I suggest /var/state/flexbackup for the stamp/indexes? +# See the FHS, http://www.pathname.com/fhs/2.0/fhs-5.11.html +# BSD users probably want /var/db/flexbackup +} diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10MtTell b/root/etc/e-smith/templates/etc/flexbackup.conf/10MtTell new file mode 100644 index 0000000..173093d --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10MtTell @@ -0,0 +1,5 @@ +{ + $OUT =<<'HERE'; +$mt{'tell'} = 'status'; +HERE +} diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10NoCompressTypes00 b/root/etc/e-smith/templates/etc/flexbackup.conf/10NoCompressTypes00 new file mode 100644 index 0000000..caf32d3 --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10NoCompressTypes00 @@ -0,0 +1,4 @@ +{# File extensions that should not be compressed (seperate with spaces) +# For afio and zip only (since they do each file individually)} +$nocompress_types = 'mp3 Z z gz gif zip lha jpeg jpg taz tgz deb rpm bz2'; + diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10TarParams b/root/etc/e-smith/templates/etc/flexbackup.conf/10TarParams new file mode 100644 index 0000000..dfe8fbe --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10TarParams @@ -0,0 +1,9 @@ +{# ---------------------------------------------------------------------- +# Parameters for 'tar' only + +# True to show record numbers} +$tar_echo_record_num = 'false'; +{ +# True to preserve file access times} +$tar_atime_preserve = 'true'; + diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10Traverse_fs b/root/etc/e-smith/templates/etc/flexbackup.conf/10Traverse_fs new file mode 100644 index 0000000..13fe417 --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10Traverse_fs @@ -0,0 +1,4 @@ +{# Span across filesytems? ("dump" will ignore this option) +# Set to "false" (don't) , "local" (all but nfs), or "all" (everything)} +$traverse_fs = 'false'; + diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10ZipParams b/root/etc/e-smith/templates/etc/flexbackup.conf/10ZipParams new file mode 100644 index 0000000..151c4be --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10ZipParams @@ -0,0 +1,4 @@ +{# ---------------------------------------------------------------------- +# Parameters for 'zip' only + +} diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10filesystems b/root/etc/e-smith/templates/etc/flexbackup.conf/10filesystems new file mode 100644 index 0000000..0bf1108 --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10filesystems @@ -0,0 +1,31 @@ +{ +# List the filesystems you wish to dump when 'all' is given +# Just a simple space-separated list +# Remote filesystems should denoted as 'host:dir' +# +# Example: +# $filesystems[0] = '/ /usr /home machine1:/usr machine2:/home'; +# +# If you want an 'all' level 0 backup to span multiple tapes, add more lines +# You will be prompted for tape change in between. +# + my @filesys = (); + my $outstring; + + open(FSTAB, ") + { + /\S+\s+(\S+)\s+(\S+)\s+(\S+)/ && + ($2 eq "ext2" or $2 eq "ext3" or $2 eq "ext4" or $2 eq "xfs") && + $3 !~ /(?:noauto|loop)/ && + $1 !~ /^\/var\/spool\/squid/ && + $1 !~ /^\/boot$/ && + push @filesys, $1; + } + close FSTAB; + $outstring = "\$set{'full'} = '"; + $outstring .= join(' ', @filesys); + $outstring .= "';"; + $outstring; +} + diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10prune_tree b/root/etc/e-smith/templates/etc/flexbackup.conf/10prune_tree new file mode 100644 index 0000000..a619d84 --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10prune_tree @@ -0,0 +1,10 @@ +{ + my @prunelist = split(',', $flexbackup{Prune} || ''); + + return "" unless (scalar @prunelist); + + $OUT = '$prune'; + $OUT .= "{'/'} = '"; + $OUT .= join(' ', @prunelist); + $OUT .= "';"; +} diff --git a/root/etc/e-smith/templates/etc/flexbackup.conf/10type b/root/etc/e-smith/templates/etc/flexbackup.conf/10type new file mode 100644 index 0000000..1541329 --- /dev/null +++ b/root/etc/e-smith/templates/etc/flexbackup.conf/10type @@ -0,0 +1,4 @@ +$type = '{# Archive type? afio, dump, tar, cpio, or zip + my $type = $flexbackup{Type} || 'tar'; + $OUT = "$type"; +}';