at the end of the tape. For most tape drives, this is totally
transparent and nothing needs to be done. For FreeBSD see below.
- FreeBSD users NOTE!!!!!
- You MUST add the following two records to your SD Device resource for
+ You may need the following two records to your SD Device resource for
tape drives.
TWOEOF = yes
Fast Forward Space File = no
+ The "Fast Forward Space File" is surely needed, and the TWOEOF
+ is needed on some systems and not others. Running the btape
+ "test" command will tell you.
+
- The daemon protocol has changed, you must update everything at once.
- The database level has been updated. You must either re-initialize
your databases with:
- Fixed thread race problem in multiple simultaneous jobs to
a single Volume where the volume lable is not in the first
tape block, so the tape is not recognized.
-
For version 1.35:
+- Add code to check for tape alerts -- tapeinfo.
- Make sure list of Volumes needed is in correct order for restore.
See havana.
- Remove paths (and files that reference them) that have no trailing slash
name last backed up, the completefile is dumped.On Windows systems, with
creation date of files, we can be evensmarter about this and not count
entirely upon the length.On a restore, the full and all incrementals
- since it will beapplied in sequence to restore the file. - Add a
- regression test for dbcheck. - Add disk seeking on restore. - Allow
+ since it will beapplied in sequence to restore the file.
+- Add a regression test for dbcheck.
+- Add disk seeking on restore. - Allow
for optional cancelling of SD and FD in case DIR
gets a fatal error. Requested by Jesse Guardiani <jesse@wingnet.net>
- Bizarre message: Error: Could not open WriteBootstrap file:
The dates you will find in your restore log seem to be the original
creation dates
- Volume "add"ed to Pool gets recycled in first use. VolBytes=0
-- Get rid of 0 dates in LastWritten, ...
- If a tape is recycled while it is mounted, Stanislav Tvrudy must do an
additional mount to deblock the job.
- From Johan Decock:
# you will have the following input to this script:
#
# mtx-changer "changer-device" "command" "slot" "archive-device" "drive-index"
+# $1 $2 $3 $4 $5
#
# for example:
#
dt, JobName);
sendit(buf, strlen(buf), arg);
}
- sendit("\n", 1, arg);
+ sendit("====\n", 1, arg);
unlock_last_jobs_list();
}
bnet_fsend(user, "\n");
do_status(bsock_sendit, (void *)user);
- bnet_fsend(user, "====\n");
bnet_sig(user, BNET_EOD);
return 1;
if (stat != 0) {
stat = ECHILD;
}
- Dmsg1(200, "status =%d\n", stat);
+ Dmsg1(200, "child status=%d\n", stat);
} else if (WIFSIGNALED(chldstatus)) { /* process died */
stat = ECHILD;
Dmsg0(200, "Signaled\n");
}
if (results) {
mp_chr(results)[0] = 0;
- stat1 = fgets(mp_chr(results), sizeof_pool_memory(results), bpipe->rfd) == NULL;
+ fgets(mp_chr(results), sizeof_pool_memory(results), bpipe->rfd);
+ if (feof(bpipe->rfd)) {
+ stat1 = 0;
+ } else {
+ stat1 = ferror(bpipe->rfd);
+ }
+ if (stat1 < 0) {
+ Dmsg2(100, "Run program fgets stat=%d ERR=%s\n", stat1, strerror(errno));
+ } else if (stat1 != 0) {
+ Dmsg1(100, "Run program fgets stat=%d\n", stat1);
+ }
} else {
stat1 = 0;
}
stat2 = close_bpipe(bpipe);
- return stat2 != 0 ? stat2 : stat1;
+ stat1 = stat2 != 0 ? stat2 : stat1;
+ Dmsg1(100, "Run program returning %d\n", stat1);
+ return stat1;
}
if (already_dead) {
exit(1);
}
- Dmsg1(200, "sig=%d\n", sig);
+ Dmsg2(200, "sig=%d %s\n", sig, sig_names[sig]);
/* Ignore certain signals */
if (sig == SIGCHLD || sig == SIGUSR2) {
return;
#include "stored.h" /* pull in Storage Deamon headers */
/* Forward referenced functions */
-static char *edit_device_codes(JCR *jcr, char *omsg, char *imsg, char *cmd);
+char *edit_device_codes(JCR *jcr, char *omsg, char *imsg, char *cmd);
static int get_autochanger_loaded_slot(JCR *jcr);
* cmd = command string (load, unload, ...)
*
*/
-static char *edit_device_codes(JCR *jcr, char *omsg, char *imsg, char *cmd)
+char *edit_device_codes(JCR *jcr, char *omsg, char *imsg, char *cmd)
{
char *p;
const char *str;
/* External subroutines */
extern void free_config_resources();
+extern char *edit_device_codes(JCR *jcr, char *omsg, char *imsg, char *cmd);
/* Exported variables */
int quit = 0;
static void rawfill_cmd();
static void bfill_cmd();
static bool open_the_device();
-static char *edit_device_codes(JCR *jcr, char *omsg, char *imsg, char *cmd);
static void autochangercmd();
static void do_unfill();
{
POOLMEM *results, *changer;
int slot, status, loaded;
- int timeout = 120;
+ int timeout = jcr->device->max_changer_wait;
int sleep_time = 0;
+ Dmsg1(100, "Max changer wait = %d sec\n", timeout);
if (!dev_cap(dev, CAP_AUTOCHANGER)) {
return 1;
}
if (status == 0) {
loaded = atoi(results);
} else {
- Pmsg1(-1, _("3991 Bad autochanger \"load slot\" status=%d.\n"), status);
- loaded = -1; /* force unload */
+ Pmsg1(-1, _("3991 Bad autochanger command: %s\n"), changer);
+ Pmsg2(-1, _("3991 status=%d result=%s\n"), status, results);
goto bail_out;
}
if (loaded) {
Pmsg1(-1, "Slot %d loaded. I am going to unload it.\n", loaded);
} else {
- Pmsg0(-1, "Nothing loaded into the drive. OK.\n");
+ Pmsg0(-1, "Nothing loaded in the drive. OK.\n");
}
Dmsg1(100, "Results from loaded query=%s\n", results);
if (loaded) {
+ jcr->VolCatInfo.Slot = loaded;
offline_or_rewind_dev(dev);
/* We are going to load a new tape, so close the device */
force_close_dev(dev);
- Pmsg0(-1, _("3302 Issuing autochanger \"unload\" command.\n"));
+ Pmsg2(-1, _("3302 Issuing autochanger \"unload %d %d\" command.\n"),
+ loaded, dev->drive_index);
changer = edit_device_codes(jcr, changer,
jcr->device->changer_command, "unload");
- status = run_program(changer, timeout, NULL);
+ status = run_program(changer, timeout, results);
Pmsg2(-1, "unload status=%s %d\n", status==0?"OK":"Bad", status);
+ if (status != 0) {
+ Pmsg1(-1, _("3992 Bad autochanger command: %s\n"), changer);
+ Pmsg2(-1, _("3992 status=%d result=%s\n"), status, results);
+ }
}
/*
* Load the Slot 1
*/
- Pmsg1(-1, _("3303 Issuing autochanger \"load slot %d\" command.\n"), slot);
+
+ slot = 1;
+ jcr->VolCatInfo.Slot = slot;
+ Pmsg2(-1, _("3303 Issuing autochanger \"load slot %d %d\" command.\n"),
+ slot, dev->drive_index);
changer = edit_device_codes(jcr, changer, jcr->device->changer_command, "load");
- Dmsg1(200, "Changer=%s\n", changer);
- status = run_program(changer, timeout, NULL);
+ Dmsg1(100, "Changer=%s\n", changer);
+ force_close_dev(dev);
+ status = run_program(changer, timeout, results);
if (status == 0) {
- Pmsg1(-1, _("3304 Autochanger \"load slot %d\" status is OK.\n"), slot);
+ Pmsg2(-1, _("3303 Autochanger \"load slot %d %d\" status is OK.\n"),
+ slot, dev->drive_index);
} else {
- Pmsg1(-1, _("3992 Bad autochanger \"load slot\" status=%d.\n"), status);
+ Pmsg1(-1, _("3993 Bad autochanger command: %s\n"), changer);
+ Pmsg2(-1, _("3993 status=%d result=%s\n"), status, results);
goto bail_out;
}
dcr->VolCatInfo.Slot = volnum;
}
+#ifdef xxx
/*
* Edit codes into ChangerCommand
* %% = %
}
return omsg;
}
+#endif
#ifdef xxxx_needed
/*
#undef VERSION
#define VERSION "1.33.6"
#define VSTRING "1"
-#define BDATE "01 Apr 2004"
-#define LSMDATE "01Apr04"
+#define BDATE "02 Apr 2004"
+#define LSMDATE "02Apr04"
/* Debug flags */
#undef DEBUG