initial commit of file from CVS for e-smith-flexbackup on Wed 12 Jul 08:54:20 BST 2023
parent
774ef452c7
commit
4a4231dda8
@ -0,0 +1,4 @@
|
||||
*.rpm
|
||||
*.log
|
||||
*spec-20*
|
||||
*.tar.xz
|
@ -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)
|
@ -1,3 +1,17 @@
|
||||
# e-smith-flexbackup
|
||||
# <img src="https://www.koozali.org/images/koozali/Logo/Png/Koozali_logo_2016.png" width="25%" vertical="auto" style="vertical-align:bottom"> e-smith-flexbackup
|
||||
|
||||
SMEServer Koozali developed git repo for e-smith-flexbackup smeserver
|
||||
SMEServer Koozali developed git repo for e-smith-flexbackup smeserver
|
||||
|
||||
## Wiki
|
||||
<br />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
|
||||
|
||||
<br />*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*
|
||||
<br />
|
||||
|
||||
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.
|
||||
|
@ -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 <bugs@e-smith.com>
|
||||
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 <charlieb@e-smith.com>
|
||||
- [1.9.0-01]
|
||||
- Changing version to development stream number - 1.9.0
|
||||
|
||||
* Thu Jun 26 2003 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.8.0-01]
|
||||
- Changing version to stable stream number to 1.8.0
|
||||
|
||||
* Thu Jun 19 2003 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.7.1-07]
|
||||
- Enable buffering using "buffer" rather than "mbuffer". [charlieb 9053]
|
||||
|
||||
* Wed Jun 18 2003 Charlie Brady <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [1.7.1-02]
|
||||
- Port configuration to newest version of flexbackup. [charlieb 9014]
|
||||
- s/Copyright/License/.
|
||||
|
||||
* Thu Jun 12 2003 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.7.1-01]
|
||||
- Roll new development stream to 1.7.1
|
||||
|
||||
* Thu Jun 12 2003 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.7.0-04]
|
||||
- Allow blocksize to be controlled by a db parameter. [charlieb 9017]
|
||||
|
||||
* Fri May 16 2003 Gordon Rowell <gordonr@e-smith.com>
|
||||
- [1.7.0-03]
|
||||
- Modified tape-restore-flexbackup to use esmith::Backup library [gordonr 8766]
|
||||
|
||||
* Wed Apr 16 2003 Tony Clayton <apc@e-smith.com>
|
||||
- [1.7.0-02]
|
||||
- Skip loopback filesystems during backup [tonyc 7749]
|
||||
|
||||
* Wed Nov 6 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.7.0-01]
|
||||
- Rolling development stream version to 1.7.0
|
||||
|
||||
* Fri Oct 11 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.6.0-01]
|
||||
- Roll to maintained version number to 1.6.0
|
||||
|
||||
* Fri Oct 11 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.6.0-01]
|
||||
- Roll to maintained version number to 1.6.0
|
||||
|
||||
* Fri Aug 9 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [1.5.1-01]
|
||||
- Change fstab grok in flexbackup.conf template to handle ext3 file
|
||||
systems. [charlieb 4588]
|
||||
|
||||
* Wed Jun 5 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.5.0-01]
|
||||
- Changing version to maintained stream number to 1.5.0
|
||||
|
||||
* Fri May 31 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [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 <gordonr@e-smith.com>
|
||||
- [1.3.3-01]
|
||||
- RPM rebuild forced by cvsroot2rpm
|
||||
|
||||
* Sun Mar 17 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.3.2-01]
|
||||
- Restore /root rather than just /root/.ssh. [charlieb #2322]
|
||||
|
||||
* Sun Mar 17 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.3.1-01]
|
||||
- Test build to verify CVS conversion.
|
||||
|
||||
* Sun Mar 17 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [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 <peters@e-smith.com>
|
||||
- [1.2.0-06]
|
||||
- Changed license to GPL
|
||||
|
||||
* Mon Feb 12 2001 Adrian Chung <adrianc@e-smith.com>
|
||||
- [1.2.0-05]
|
||||
- rolling release number for GPG signing.
|
||||
|
||||
* Sun Feb 11 2001 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.2.0-04]
|
||||
- Include etc/e-smith/templates-user-custom in restore fileset.
|
||||
|
||||
* Thu Feb 8 2001 Adrian Chung <adrianc@e-smith.com>
|
||||
- Rolling release number for GPG signing.
|
||||
|
||||
* Thu Feb 8 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [1.2.0-02]
|
||||
- Using correct path for /flexbackup.extract.log in email messages.
|
||||
|
||||
* Thu Jan 25 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [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 <peters@e-smith.com>
|
||||
- [1.1.0-10]
|
||||
- Removed duplicated filesystem code from 10Compression template fragment
|
||||
|
||||
* Tue Jan 23 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [1.1.0-09]
|
||||
- Forced padding of blocks when writing to tapes
|
||||
|
||||
* Sat Jan 13 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [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 <peters@e-smith.com>
|
||||
- [1.1.0-06]
|
||||
- tape-restore-flexbackup now send mail to admin on success or failure
|
||||
|
||||
* Fri Jan 12 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [1.1.0-4]
|
||||
- Fix silly syntax errors in template
|
||||
- Migrate old flexbackup service entry to new.
|
||||
|
||||
* Fri Jan 12 2001 Charlie Brady <charlieb@e-smith.com>
|
||||
- [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 <peters@e-smith.com>
|
||||
- [1.1.0-02]
|
||||
- Ensured that /sbin is included in $PATH for flexbackup cron job
|
||||
|
||||
* Tue Jan 9 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [1.1.0-01]
|
||||
- Rolled version number to 1.1.0-01. Includes patches upto 0.1-11
|
||||
|
||||
* Mon Jan 8 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [0.1-11]
|
||||
- Cron job now rewinds the tape after the backup
|
||||
|
||||
* Sat Jan 6 2001 Jason Miller <jmiller@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [0.1-8]
|
||||
- Only run %post sript when in runlevel 7
|
||||
|
||||
* Wed Jan 3 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [0.1-7]
|
||||
- Added use esmith::db to /etc/cron.d/flexbackup template
|
||||
|
||||
* Wed Dec 27 2000 Peter Samuel <peters@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- 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 <charlieb@e-smith.com>
|
||||
- Make flexbackup.conf a directory template
|
||||
- Tweak a few settings - see patch for details.
|
||||
|
||||
* Mon May 22 2000 Charlie Brady <charlieb@e-smith.net>
|
||||
- Generate file system list from /etc/fstab
|
||||
- Fix missing %conf declaration in action script
|
||||
|
||||
* Mon May 22 2000 Charlie Brady <charlieb@e-smith.net>
|
||||
- Fix spec file to include all relevant files
|
||||
- Fix post script : cron -> crond
|
||||
|
||||
* Sun May 14 2000 Charlie Brady <charlieb@e-smith.net>
|
||||
- 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)
|
@ -0,0 +1 @@
|
||||
sme10
|
@ -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
|
||||
|
@ -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 <brianr@koozali.org> 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 <tests@pialasse.com> 2.6.0-3.sme
|
||||
- add update event [SME: 11134]
|
||||
|
||||
* Sat Dec 26 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 2.6.0-2.sme
|
||||
- Add XFS support - thanks to John Bennett [SME: 11292]
|
||||
|
||||
* Sat Feb 06 2016 stephane de Labrusse <stephdl@de-labrusse.fr> 2.6.0-1.sme
|
||||
- Initial release to sme10
|
||||
|
||||
* Sat Oct 19 2013 John H. Bennett III <bennettj@johnbennettservices.com> 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 <bennettj@johnbennettservices.com> 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 <slords@mail.com> 2.4.0-1.sme
|
||||
- Roll new stream for sme9
|
||||
|
||||
* Tue Oct 7 2008 Shad L. Lords <slords@mail.com> 2.2.0-1.sme
|
||||
- Roll new stream to separate sme7/sme8 trees [SME: 4633]
|
||||
|
||||
* Sun Apr 29 2007 Shad L. Lords <slords@mail.com>
|
||||
- Clean up spec so package can be built by koji/plague
|
||||
|
||||
* Thu Dec 07 2006 Shad L. Lords <slords@mail.com>
|
||||
- Update to new release naming. No functional changes.
|
||||
- Make Packager generic
|
||||
|
||||
* Thu Apr 20 2006 Charlie Brady <charlie_brady@mitel.com> 1.10.0-02
|
||||
- Remove redundant "mt fsf" from DetermineBlocksize(). [SME: 1191]
|
||||
|
||||
* Wed Mar 15 2006 Charlie Brady <charlie_brady@mitel.com> 1.10.0-01
|
||||
- Roll stable stream version. [SME: 1016]
|
||||
|
||||
* Mon Jan 23 2006 Charlie Brady <charlieb@e-smith.com> 1.9.0-18
|
||||
- Fix spelling of blksize parameter when running flexbackup to restore.
|
||||
[SME: 375]
|
||||
|
||||
* Sun Jan 22 2006 Charlie Brady <charlieb@e-smith.com> 1.9.0-17
|
||||
- Fix some perl warnings from last change. [SME: 375]
|
||||
|
||||
* Sun Jan 8 2006 Charlie Brady <charlieb@e-smith.com> 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 <gordonr@gormand.com.au> 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 <charlieb@e-smith.com> 1.9.0-14
|
||||
- Remove attempted autdetection of backup type, since it doesn't
|
||||
work. [SME: 340]
|
||||
|
||||
* Wed Nov 30 2005 Gordon Rowell <gordonr@gormand.com.au> 1.9.0-13
|
||||
- Bump release number only
|
||||
|
||||
* Sun Nov 20 2005 Gordon Rowell <gordonr@e-smith.com>
|
||||
- [1.9.0-12]
|
||||
- Output nothing (not '0') when there is no prune list [SF: 1360696]
|
||||
|
||||
* Thu Oct 20 2005 Charlie Brady <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [1.9.0-08]
|
||||
- Update to current db access APIs. [SF: 1216546]
|
||||
|
||||
* Thu Jun 2 2005 Charlie Brady <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [1.9.0-06]
|
||||
- Fix quoting of erase_rewind_only value [SF: 1192822]
|
||||
|
||||
* Mon Mar 14 2005 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.9.0-05]
|
||||
- Fix stray } in 10EraseRwindOnly template fragment (introduced in last
|
||||
change set).
|
||||
|
||||
* Mon Mar 14 2005 Charlie Brady <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [1.9.0-03]
|
||||
- Remove dangling clobber-flexbackup-cron symlink. [MN00065727]
|
||||
|
||||
* Tue Jan 25 2005 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.9.0-02]
|
||||
- Remove obsolete clobber-flexbackup-cron action. [MN00065727]
|
||||
|
||||
* Sun Jan 16 2005 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.9.0-01]
|
||||
- Changing version to development stream number - 1.9.0
|
||||
|
||||
* Thu Jun 26 2003 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.8.0-01]
|
||||
- Changing version to stable stream number to 1.8.0
|
||||
|
||||
* Thu Jun 19 2003 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.7.1-07]
|
||||
- Enable buffering using "buffer" rather than "mbuffer". [charlieb 9053]
|
||||
|
||||
* Wed Jun 18 2003 Charlie Brady <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [1.7.1-02]
|
||||
- Port configuration to newest version of flexbackup. [charlieb 9014]
|
||||
- s/Copyright/License/.
|
||||
|
||||
* Thu Jun 12 2003 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.7.1-01]
|
||||
- Roll new development stream to 1.7.1
|
||||
|
||||
* Thu Jun 12 2003 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.7.0-04]
|
||||
- Allow blocksize to be controlled by a db parameter. [charlieb 9017]
|
||||
|
||||
* Fri May 16 2003 Gordon Rowell <gordonr@e-smith.com>
|
||||
- [1.7.0-03]
|
||||
- Modified tape-restore-flexbackup to use esmith::Backup library [gordonr 8766]
|
||||
|
||||
* Wed Apr 16 2003 Tony Clayton <apc@e-smith.com>
|
||||
- [1.7.0-02]
|
||||
- Skip loopback filesystems during backup [tonyc 7749]
|
||||
|
||||
* Wed Nov 6 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.7.0-01]
|
||||
- Rolling development stream version to 1.7.0
|
||||
|
||||
* Fri Oct 11 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.6.0-01]
|
||||
- Roll to maintained version number to 1.6.0
|
||||
|
||||
* Fri Oct 11 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.6.0-01]
|
||||
- Roll to maintained version number to 1.6.0
|
||||
|
||||
* Fri Aug 9 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [1.5.1-01]
|
||||
- Change fstab grok in flexbackup.conf template to handle ext3 file
|
||||
systems. [charlieb 4588]
|
||||
|
||||
* Wed Jun 5 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.5.0-01]
|
||||
- Changing version to maintained stream number to 1.5.0
|
||||
|
||||
* Fri May 31 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [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 <gordonr@e-smith.com>
|
||||
- [1.3.3-01]
|
||||
- RPM rebuild forced by cvsroot2rpm
|
||||
|
||||
* Sun Mar 17 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.3.2-01]
|
||||
- Restore /root rather than just /root/.ssh. [charlieb #2322]
|
||||
|
||||
* Sun Mar 17 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.3.1-01]
|
||||
- Test build to verify CVS conversion.
|
||||
|
||||
* Sun Mar 17 2002 Charlie Brady <charlieb@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [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 <peters@e-smith.com>
|
||||
- [1.2.0-06]
|
||||
- Changed license to GPL
|
||||
|
||||
* Mon Feb 12 2001 Adrian Chung <adrianc@e-smith.com>
|
||||
- [1.2.0-05]
|
||||
- rolling release number for GPG signing.
|
||||
|
||||
* Sun Feb 11 2001 Charlie Brady <charlieb@e-smith.com>
|
||||
- [1.2.0-04]
|
||||
- Include etc/e-smith/templates-user-custom in restore fileset.
|
||||
|
||||
* Thu Feb 8 2001 Adrian Chung <adrianc@e-smith.com>
|
||||
- Rolling release number for GPG signing.
|
||||
|
||||
* Thu Feb 8 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [1.2.0-02]
|
||||
- Using correct path for /flexbackup.extract.log in email messages.
|
||||
|
||||
* Thu Jan 25 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [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 <peters@e-smith.com>
|
||||
- [1.1.0-10]
|
||||
- Removed duplicated filesystem code from 10Compression template fragment
|
||||
|
||||
* Tue Jan 23 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [1.1.0-09]
|
||||
- Forced padding of blocks when writing to tapes
|
||||
|
||||
* Sat Jan 13 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [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 <peters@e-smith.com>
|
||||
- [1.1.0-06]
|
||||
- tape-restore-flexbackup now send mail to admin on success or failure
|
||||
|
||||
* Fri Jan 12 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [1.1.0-4]
|
||||
- Fix silly syntax errors in template
|
||||
- Migrate old flexbackup service entry to new.
|
||||
|
||||
* Fri Jan 12 2001 Charlie Brady <charlieb@e-smith.com>
|
||||
- [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 <peters@e-smith.com>
|
||||
- [1.1.0-02]
|
||||
- Ensured that /sbin is included in $PATH for flexbackup cron job
|
||||
|
||||
* Tue Jan 9 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [1.1.0-01]
|
||||
- Rolled version number to 1.1.0-01. Includes patches upto 0.1-11
|
||||
|
||||
* Mon Jan 8 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [0.1-11]
|
||||
- Cron job now rewinds the tape after the backup
|
||||
|
||||
* Sat Jan 6 2001 Jason Miller <jmiller@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- [0.1-8]
|
||||
- Only run %post sript when in runlevel 7
|
||||
|
||||
* Wed Jan 3 2001 Peter Samuel <peters@e-smith.com>
|
||||
- [0.1-7]
|
||||
- Added use esmith::db to /etc/cron.d/flexbackup template
|
||||
|
||||
* Wed Dec 27 2000 Peter Samuel <peters@e-smith.com>
|
||||
- [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 <charlieb@e-smith.com>
|
||||
- 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 <charlieb@e-smith.com>
|
||||
- Make flexbackup.conf a directory template
|
||||
- Tweak a few settings - see patch for details.
|
||||
|
||||
* Mon May 22 2000 Charlie Brady <charlieb@e-smith.net>
|
||||
- Generate file system list from /etc/fstab
|
||||
- Fix missing %conf declaration in action script
|
||||
|
||||
* Mon May 22 2000 Charlie Brady <charlieb@e-smith.net>
|
||||
- Fix spec file to include all relevant files
|
||||
- Fix post script : cron -> crond
|
||||
|
||||
* Sun May 14 2000 Charlie Brady <charlieb@e-smith.net>
|
||||
- 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)
|
@ -0,0 +1 @@
|
||||
32
|
@ -0,0 +1 @@
|
||||
20
|
@ -0,0 +1 @@
|
||||
buffer
|
@ -0,0 +1 @@
|
||||
0
|
@ -0,0 +1 @@
|
||||
tar
|
@ -0,0 +1 @@
|
||||
true
|
@ -0,0 +1 @@
|
||||
backupservice
|
@ -0,0 +1,4 @@
|
||||
#! /bin/sh
|
||||
|
||||
cd /
|
||||
exec /usr/bin/flexbackup -set all -noreten
|
@ -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;
|
||||
}
|
@ -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';
|
||||
|
@ -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 . '";';
|
||||
}
|
@ -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}
|
||||
|
@ -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)}
|
||||
|
@ -0,0 +1,6 @@
|
||||
{# ----------------------------------------------------------------------
|
||||
# Parameters for 'cpio' only
|
||||
|
||||
# Format of cpio archive}
|
||||
$cpio_format = 'newc';
|
||||
|
@ -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';";
|
||||
}
|
@ -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';
|
||||
|
@ -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'
|
||||
}';
|
@ -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';
|
||||
|
@ -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.*';
|
@ -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 }
|
@ -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
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
$OUT =<<'HERE';
|
||||
$mt{'tell'} = 'status';
|
||||
HERE
|
||||
}
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -0,0 +1,4 @@
|
||||
{# ----------------------------------------------------------------------
|
||||
# Parameters for 'zip' only
|
||||
|
||||
}
|
@ -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, "</etc/fstab") or die "Can't open fstab file";
|
||||
while (<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;
|
||||
}
|
||||
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
my @prunelist = split(',', $flexbackup{Prune} || '');
|
||||
|
||||
return "" unless (scalar @prunelist);
|
||||
|
||||
$OUT = '$prune';
|
||||
$OUT .= "{'/'} = '";
|
||||
$OUT .= join(' ', @prunelist);
|
||||
$OUT .= "';";
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
$type = '{# Archive type? afio, dump, tar, cpio, or zip
|
||||
my $type = $flexbackup{Type} || 'tar';
|
||||
$OUT = "$type";
|
||||
}';
|
Loading…
Reference in New Issue