-$Id: CHANGES,v 1.51 2000/03/09 13:12:31 stelian Exp $
+$Id: CHANGES,v 1.52 2000/03/10 10:03:09 stelian Exp $
Changes between versions 0.4b15 and 0.4b16 (released ?????????????)
===================================================================
Thanks to Dejan Muhamedagic <dejan@quant-x.com> for the
patch.
+5. Added the device name and the current volume number
+ as arguments to the end of tape script (dump -F option).
+
Changes between versions 0.4b14 and 0.4b15 (released March 2, 2000)
===================================================================
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: dump.8.in,v 1.13 2000/03/02 12:07:36 stelian Exp $
+.\" $Id: dump.8.in,v 1.14 2000/03/10 10:03:09 stelian Exp $
.\"
.Dd __DATE__
.Dt DUMP 8
this can be overridden by the environment variable
.Ev RMT .
.It Fl F Ar script
-Run script at the end of each tape. The script must return 0 if
+Run script at the end of each tape. The device name and the
+current volume number are passed on the command line.
+The script must return 0 if
.Nm
should continue without asking the user to change the tape, 1 if
.Nm
#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.16 2000/03/02 12:07:36 stelian Exp $";
+ "$Id: tape.c,v 1.17 2000/03/10 10:03:09 stelian Exp $";
#endif /* not lint */
#ifdef __linux__
static void flushtape __P((void));
static void killall __P((void));
static void rollforward __P((void));
-static int system_command __P((const char *command));
+static int system_command __P((const char *, const char *, int));
/*
* Concurrent dump mods (Caltech) - disk block reading and tape writing
* Returns -1 if an error occured, the exit status of
* the command on success.
*/
-int system_command(const char *command) {
+int system_command(const char *command, const char *device, int volnum) {
int pid, status;
+ char commandstr[4096];
pid = fork();
if (pid == -1) {
if (pid == 0) {
setuid(getuid());
setgid(getgid());
- execl("/bin/sh", "sh", "-c", command, NULL);
+ snprintf(commandstr, sizeof(commandstr), "%s %s %d", command, device, volnum);
+ commandstr[sizeof(commandstr) - 1] = '\0';
+ execl("/bin/sh", "sh", "-c", commandstr, NULL);
perror(" DUMP: unable to execute shell");
exit(-1);
}
eot_code = 1;
if (eot_script) {
msg("Launching %s\n", eot_script);
- eot_code = system_command(eot_script);
+ eot_code = system_command(eot_script, tape, tapeno);
}
if (eot_code != 0 && eot_code != 1) {
msg("Dump aborted by the end of tape script\n");