diff options
Diffstat (limited to 'backup.in')
-rw-r--r-- | backup.in | 39 |
1 files changed, 28 insertions, 11 deletions
@@ -1,15 +1,32 @@ #! /bin/bash -# This script creates a backup of this system. For usage instructions, -# run `backup --help'. For a detailed description of the backup and -# restore procedures, see /export/backup/snapshot/README. - -libdir=@LIBDIR@/backup +# This file is part of BEAM +# Copyright (C) 2012 Sergey Poznyakoff +# +# BEAM 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 3, or (at your option) +# any later version. +# +# BEAM 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 BEAM. If not, see <http://www.gnu.org/licenses/>. + +libdir=@LIBDIR@/beam set -e . $libdir/common.sh set +e ts=`date +%Y%m%d`; week=`date +%U` +if [ "$1" = "--wtf" ]; then + wtf $(basename $0) create a backup + exit 0 +fi + load_config taroptions="-c -Hpax $backup_tar_options $backup_rsh_command" @@ -66,7 +83,7 @@ do case $1 in -v|--verbose) verbose="$verbose -v";; -l|--logfile) shift; backup_logfile=$1;; - -n|--dry-run) dry_run=echo;; + -n|--dry-run) dry_run=echo; backup_logfile=;; -N|--no-logfile) backup_logfile=;; -h|--help) help;; -V|--version) print_version;; @@ -85,10 +102,10 @@ fi logit "started" if test -n "$backup_retain_interval" && test $backup_retain_interval -gt 0; then - backup-cleaner --retain $backup_retain_interval --verbose \ - --suffix .tar.bz2 $backup_archive_dir - backup-cleaner --retain $backup_retain_interval --verbose \ - --suffix .db $backup_snapshot_dir + @LIBEXECDIR@/beam-cleaner --retain $backup_retain_interval $verbose \ + --suffix .tar.bz2 $backup_archive_dir + @LIBEXECDIR@/beam-cleaner --retain $backup_retain_interval $verbose \ + --suffix .db $backup_snapshot_dir fi runhook prologue_hook @@ -100,7 +117,7 @@ do ${type}_backup $item done -trap '' EXIT INT QUIT TERM +trap - EXIT INT QUIT TERM runhook epilogue_hook logit "finished" |