2 # This file is included in the GNU tar distribution as an example. It is
3 # not used by default unless the proper line is uncommented in backup-specs.
4 # System administrators will probably want to customize this and
5 # backup-specs for their site.
7 # This script should be run by tar with --info-script (-F) to inform
8 # interested parties that a tape for the next volume of the backup needs to
9 # be put in the tape drive.
11 # Copyright 2004-2005, 2010, 2012-2014, 2016 Free Software Foundation,
14 # This file is part of GNU tar.
16 # GNU tar is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 3 of the License, or
19 # (at your option) any later version.
21 # GNU tar is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with this program. If not, see <http://www.gnu.org/licenses/>.
29 # Include location of 'sendmail' and GNU finger.
30 PATH="/usr/lib:/usr/local/gnubin:${PATH}"
33 # Load library routines
34 SYSCONFDIR=${SYSCONFDIR-@sysconfdir@}
35 . ${LIBPATH-@libexecdir@}/backup.sh
40 # Get a list of people to whom to mail a request for changing the tape.
41 # This egregious nightmare parses the output from GNU finger which shows
42 # which users are logged into consoles (and thus in the office and capable
45 # Certain users (like 'root') aren't real users, and shouldn't be notified.
46 # Neither should 'zippy', 'elvis', etc. (on the GNU machines) since they're
49 finger .clients 2> /dev/null \
52 /clientstatus: file has not changed in/{
57 s/^..................................................//
68 s/\(\n\)\([A-Za-z0-9_][A-Za-z0-9_]*\)\(\n.*\)\2\(.*\)/\1\2\3\4/g
80 # Customized behavior for FSF machines, to bring attention to the fact that
81 # the tape needs to be changed (who looks at the terminal?)
82 sendmail -oi -t << __EOF__
83 From: `basename $0` (backup tape-changing reminder)
86 Subject: Backup needs new tape for volume ${TAR_VOLUME}
87 Reply-To: ${ADMINISTRATOR}
89 This is an automated report from the backup script running on
92 Volume ${TAR_VOLUME} of the backup needs to be put in the tape drive.
93 Usually whoever prepared the backup leaves labeled tapes on top of the
94 drive itself. If there aren't any more, information about where to find
95 tapes and how to label them are posted on the wall by apple-gunkies
96 (unhelpfully obscured by a bookshelf). An online copy (which is probably
97 more up-to-date) can also be found in ~friedman/etc/fsf/backup.how.
101 echo "
\aPlease put volume ${TAR_VOLUME} in tape drive and press RETURN"
103 echo "Writing volume ${TAR_VOLUME}..."
105 sendmail -oi -t << __EOF__
106 From: `basename $0` (backup tape-changing reminder)
109 Subject: Volume ${TAR_VOLUME} for backup has been added
110 Reply-To: ${ADMINISTRATOR}
112 This is an automated report from the backup script running on
115 The backup has been continued, so for now no further attention is required.