mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-07-31 04:22:37 +00:00
* ChangeLog.1, ChangeLog.CVS, Makefile.am, NEWS, README: * README-hacking, directory, doc/Makefile.am, doc/dumpdir.texi: * doc/gendocs_template, doc/intern.texi, doc/mastermenu.el: * doc/snapshot.texi, doc/sparse.texi, doc/tar-snapshot-edit.texi: * doc/value.texi, lib/Makefile.am, scripts/backup-specs: * scripts/dump-remind.in, scripts/tar-snapshot-edit, scripts/tarcat: * scripts/xsparse.c, src/arith.h, src/buffer.c, src/compare.c: * src/create.c, src/delete.c, src/exit.c, src/suffix.c, src/tar.c: * src/tar.h, src/update.c, src/warning.c, src/xheader.c: * tests/append01.at, tests/append02.at, tests/atlocal.in: * tests/delete03.at, tests/exclude.at, tests/exclude06.at: * tests/extrac04.at, tests/extrac05.at, tests/extrac06.at: * tests/extrac07.at, tests/filerem01.at, tests/filerem02.at: * tests/incr01.at, tests/incr02.at, tests/incr03.at, tests/incr06.at: * tests/label02.at, tests/label03.at, tests/label04.at: * tests/label05.at, tests/link02.at, tests/link03.at: * tests/listed01.at, tests/listed02.at, tests/long01.at: * tests/longv7.at, tests/multiv01.at, tests/multiv02.at: * tests/multiv03.at, tests/multiv05.at, tests/multiv06.at: * tests/multiv07.at, tests/multiv08.at, tests/options.at: * tests/options02.at, tests/remfiles03.at, tests/rename01.at: * tests/rename02.at, tests/rename03.at, tests/rename04.at: * tests/rename05.at, tests/same-order01.at, tests/same-order02.at: * tests/shortfile.at, tests/shortupd.at, tests/sparse01.at: * tests/sparse02.at, tests/sparsemv.at, tests/sparsemvp.at: * tests/star/README, tests/star/gtarfail2.at: * tests/star/multi-fail.at: * tests/star/pax-big-10g.at, tests/star/quicktest.sh: * tests/star/ustar-big-2g.at, tests/star/ustar-big-8g.at: * tests/update01.at, tests/update02.at, tests/volsize.at: * tests/volume.at: Remove trailing spaces and tabs from lines, and remove trailing empty lines from files. This makes it a bit easier to share code among coreutils and other projects that do this.
104 lines
3.1 KiB
Bash
104 lines
3.1 KiB
Bash
#!/bin/sh
|
|
# This file is included in the GNU tar distribution as an example. It is
|
|
# not used by default unless the proper line is uncommented in backup-specs.
|
|
# System administrators will probably want to customize this and
|
|
# backup-specs for their site.
|
|
#
|
|
# This script should be run by tar with --info-script (-F) to inform
|
|
# interested parties that a tape for the next volume of the backup needs to
|
|
# be put in the tape drive.
|
|
#
|
|
|
|
# Include location of `sendmail' and GNU finger.
|
|
PATH="/usr/lib:/usr/local/gnubin:${PATH}"
|
|
export PATH
|
|
|
|
# Load library routines
|
|
SYSCONFDIR=${SYSCONFDIR-@sysconfdir@}
|
|
. ${LIBPATH-@libexecdir@}/backup.sh
|
|
|
|
MT_REWIND
|
|
MT_OFFLINE
|
|
|
|
# Get a list of people to whom to mail a request for changing the tape.
|
|
# This egregious nightmare parses the output from GNU finger which shows
|
|
# which users are logged into consoles (and thus in the office and capable
|
|
# of changing tapes).
|
|
#
|
|
# Certain users (like `root') aren't real users, and shouldn't be notified.
|
|
# Neither should `zippy', `elvis', etc. (on the GNU machines) since they're
|
|
# just test accounts.
|
|
recipients="`
|
|
finger .clients 2> /dev/null \
|
|
| sed -ne '
|
|
1{
|
|
/clientstatus: file has not changed in/{
|
|
n;n;n;n;d
|
|
}
|
|
n;n;d
|
|
}
|
|
s/^..................................................//
|
|
$!{/^$/d
|
|
/^root?*$/d
|
|
/^zippy$/d
|
|
/^fnord$/d
|
|
/^elvis$/d
|
|
/^snurd$/d
|
|
H
|
|
}
|
|
${g
|
|
: 1
|
|
s/\(\n\)\([A-Za-z0-9_][A-Za-z0-9_]*\)\(\n.*\)\2\(.*\)/\1\2\3\4/g
|
|
s/\n$//g
|
|
t 1
|
|
s/^\n//
|
|
s/\n$//g
|
|
s/\n/, /g
|
|
: 2
|
|
s/, ,/,/g
|
|
t 2
|
|
p
|
|
}'`"
|
|
|
|
# Customized behavior for FSF machines, to bring attention to the fact that
|
|
# the tape needs to be changed (who looks at the terminal?)
|
|
sendmail -oi -t << __EOF__
|
|
From: `basename $0` (backup tape-changing reminder)
|
|
To: ${recipients}
|
|
Cc: ${ADMINISTRATOR}
|
|
Subject: Backup needs new tape for volume ${TAR_VOLUME}
|
|
Reply-To: ${ADMINISTRATOR}
|
|
|
|
This is an automated report from the backup script running on
|
|
`hostname`.
|
|
|
|
Volume ${TAR_VOLUME} of the backup needs to be put in the tape drive.
|
|
Usually whoever prepared the backup leaves labeled tapes on top of the
|
|
drive itself. If there aren't any more, information about where to find
|
|
tapes and how to label them are posted on the wall by apple-gunkies
|
|
(unhelpfully obscured by a bookshelf). An online copy (which is probably
|
|
more up-to-date) can also be found in ~friedman/etc/fsf/backup.how.
|
|
__EOF__
|
|
|
|
|
|
echo "Please put volume ${TAR_VOLUME} in tape drive and press RETURN"
|
|
read input
|
|
echo "Writing volume ${TAR_VOLUME}..."
|
|
|
|
sendmail -oi -t << __EOF__
|
|
From: `basename $0` (backup tape-changing reminder)
|
|
To: ${recipients}
|
|
Cc: ${ADMINISTRATOR}
|
|
Subject: Volume ${TAR_VOLUME} for backup has been added
|
|
Reply-To: ${ADMINISTRATOR}
|
|
|
|
This is an automated report from the backup script running on
|
|
`hostname`.
|
|
|
|
The backup has been continued, so for now no further attention is required.
|
|
__EOF__
|
|
|
|
exit 0
|
|
|
|
# eof
|