- Pruning with Admin job.
- Does WildFile match against full name? Doc.
- %d and %v only valid on Director, not for ClientRunBefore/After.
+- During tests with the 260 char fix code, I found one problem:
+ if the system "sees" a long path once, it seems to forget it's
+ working drive (e.g. c:\), which will lead to a problem during
+ the next job (create bootstrap file will fail). Here is the
+ workaround: specify absolute working and pid directory in
+ bacula-fd.conf (e.g. c:\bacula\working instead of
+ \bacula\working).
Priority:
[ possibly a Python event -- kes ]
===
+- Mount on an Autochanger with no tape in the drive causes:
+ Automatically selected Storage: LTO-changer
+ Enter autochanger drive[0]: 0
+ 3301 Issuing autochanger "loaded drive 0" command.
+ 3302 Autochanger "loaded drive 0", result: nothing loaded.
+ 3301 Issuing autochanger "loaded drive 0" command.
+ 3302 Autochanger "loaded drive 0", result: nothing loaded.
+ 3902 Cannot mount Volume on Storage Device "LTO-Drive1" (/dev/nst0) because:
+ Couldn't rewind device "LTO-Drive1" (/dev/nst0): ERR=dev.c:678 Rewind error on "LTO-Drive1" (/dev/nst0). ERR=No medium found.
+ 3905 Device "LTO-Drive1" (/dev/nst0) open but no Bacula volume is mounted.
+ If this is not a blank tape, try unmounting and remounting the Volume.
+- If Drive 0 is blocked, and drive 1 is set "Autoselect=no", drive 1 will
+ be used.
+- Autochanger did not change volumes.
+ select * from Storage;
+ +-----------+-------------+-------------+
+ | StorageId | Name | AutoChanger |
+ +-----------+-------------+-------------+
+ | 1 | LTO-changer | 0 |
+ +-----------+-------------+-------------+
+ 05-May 03:50 roxie-sd: 3302 Autochanger "loaded drive 0", result is Slot 11.
+ 05-May 03:50 roxie-sd: Tibs.2006-05-05_03.05.02 Warning: Director wanted Volume "LT
+ Current Volume "LT0-002" not acceptable because:
+ 1997 Volume "LT0-002" not in catalog.
+ 05-May 03:50 roxie-sd: Tibs.2006-05-05_03.05.02 Error: Autochanger Volume "LT0-002"
+ Setting InChanger to zero in catalog.
+ 05-May 03:50 roxie-dir: Tibs.2006-05-05_03.05.02 Error: Unable to get Media record
+
+ 05-May 03:50 roxie-sd: Tibs.2006-05-05_03.05.02 Fatal error: Error getting Volume i
+ 05-May 03:50 roxie-sd: Tibs.2006-05-05_03.05.02 Fatal error: Job 530 canceled.
+ 05-May 03:50 roxie-sd: Tibs.2006-05-05_03.05.02 Fatal error: spool.c:249 Fatal appe
+ 05-May 03:49 Tibs: Tibs.2006-05-05_03.05.02 Fatal error: c:\cygwin\home\kern\bacula
+ , got
+ (missing)
+ llist volume=LTO-002
+ MediaId: 6
+ VolumeName: LTO-002
+ Slot: 0
+ PoolId: 1
+ MediaType: LTO-2
+ FirstWritten: 2006-05-05 03:11:54
+ LastWritten: 2006-05-05 03:50:23
+ LabelDate: 2005-12-26 16:52:40
+ VolJobs: 1
+ VolFiles: 0
+ VolBlocks: 1
+ VolMounts: 0
+ VolBytes: 206
+ VolErrors: 0
+ VolWrites: 0
+ VolCapacityBytes: 0
+ VolStatus:
+ Recycle: 1
+ VolRetention: 31,536,000
+ VolUseDuration: 0
+ MaxVolJobs: 0
+ MaxVolFiles: 0
+ MaxVolBytes: 0
+ InChanger: 0
+ EndFile: 0
+ EndBlock: 0
+ VolParts: 0
+ LabelType: 0
+ StorageId: 1
+
+ Note VolStatus is blank!!!!!
+ llist volume=LTO-003
+ MediaId: 7
+ VolumeName: LTO-003
+ Slot: 12
+ PoolId: 1
+ MediaType: LTO-2
+ FirstWritten: 0000-00-00 00:00:00
+ LastWritten: 0000-00-00 00:00:00
+ LabelDate: 2005-12-26 16:52:40
+ VolJobs: 0
+ VolFiles: 0
+ VolBlocks: 0
+ VolMounts: 0
+ VolBytes: 1
+ VolErrors: 0
+ VolWrites: 0
+ VolCapacityBytes: 0
+ VolStatus: Append
+ Recycle: 1
+ VolRetention: 31,536,000
+ VolUseDuration: 0
+ MaxVolJobs: 0
+ MaxVolFiles: 0
+ MaxVolBytes: 0
+ InChanger: 0
+ EndFile: 0
+ EndBlock: 0
+ VolParts: 0
+ LabelType: 0
+ StorageId: 1
+===
+ mount
+ Automatically selected Storage: LTO-changer
+ Enter autochanger drive[0]: 0
+ 3301 Issuing autochanger "loaded drive 0" command.
+ 3302 Autochanger "loaded drive 0", result: nothing loaded.
+ 3301 Issuing autochanger "loaded drive 0" command.
+ 3302 Autochanger "loaded drive 0", result: nothing loaded.
+ 3902 Cannot mount Volume on Storage Device "LTO-Drive1" (/dev/nst0) because:
+ Couldn't rewind device "LTO-Drive1" (/dev/nst0): ERR=dev.c:678 Rewind error on "LTO-Drive1" (/dev/nst0). ERR=No medium found.
+
+ 3905 Device "LTO-Drive1" (/dev/nst0) open but no Bacula volume is mounted.
+ If this is not a blank tape, try unmounting and remounting the Volume.
+
+- The btape fill command does not seem to use the Autochanger
+- Make Windows installer default to system disk drive.
+- Look at using ioctl(FIOBMAP, ...) on Linux, and
+ DeviceIoControl(..., FSCTL_QUERY_ALLOCATED_RANGES, ...) on
+ Win32 for sparse files.
+ http://www.flexhex.com/docs/articles/sparse-files.phtml
+ http://www.informatik.uni-frankfurt.de/~loizides/reiserfs/fibmap.html
- Directive: at <event> "command"
- Command: pycmd "command" generates "command" event. How to
attach to a specific job?
Kern Sibbald
General:
+05May06
+- Correct EOF with no \n lex.c problem.
+- Tweak compat.h compat.cpp and merge with apcupsd
+- Add additional INFO messages if autochanger cannot be used.
02May06
- Simplify Win32 Makefile
- Correct count of buffers/bytes used by smartall.c
VALUE "FileDescription", "Bacula File daemon for Win32\0"
VALUE "FileVersion", VERSION "\0"
VALUE "InternalName", "Bacula\0"
- VALUE "LegalCopyright", "Copyright Kern Sibbald, 1999-2005\0"
+ VALUE "LegalCopyright", "Copyright Kern Sibbald, 1999-2006\0"
VALUE "LegalTrademarks", "Licensed under GNU GPL 2.0\0"
VALUE "OriginalFilename", "filed.exe\0"
VALUE "PrivateBuild", "\0"
LTEXT " www.bacula.org",IDC_WWW,115,70,100,10
// LTEXT " ",-1,69,81,100,10
// LTEXT " ",-1,90,70,100,10
- LTEXT "Copyright (C) 1999-2005, Kern Sibbald",IDC_COPYRIGHT,7,120,175,10
+ LTEXT "Copyright (C) 1999-2006, Kern Sibbald",IDC_COPYRIGHT,7,120,175,10
LTEXT N_("Licensed under GNU GPL 2.0."),IDC_TRADEMARK,7,130,175,10
RTEXT N_("Build Date:"),-1,108,24,42,8
RTEXT N_("Bacula Version:"),-1,100,9,50,8
* Version $Id$
*
*/
-
/*
- Copyright (C) 2000-2005 Kern Sibbald
+ Copyright (C) 2000-2006 Kern Sibbald
This program 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 2 of
- the License, or (at your option) any later version.
+ modify it under the terms of the GNU General Public License
+ version 2 as amended with additional clauses defined in the
+ file LICENSE in the main source directory.
This program 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 this program; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ the file LICENSE for additional details.
*/
+
#include "bacula.h"
#include "lex.h"
extern int debug_level;
+/* Debug level for this source file */
+static const int dbglvl = 5000;
+
/*
* Scan to "logical" end of line. I.e. end of line,
* or semicolon, but stop on T_EOB (same as end of
void scan_to_eol(LEX *lc)
{
int token;
- Dmsg0(2000, "start scan to eof\n");
+ Dmsg0(dbglvl, "start scan to eof\n");
while ((token = lex_get_token(lc, T_ALL)) != T_EOL) {
if (token == T_EOB) {
lex_unget_char(lc);
bvsnprintf(buf, sizeof(buf), msg, arg_ptr);
va_end(arg_ptr);
- if (lc->err_type == 0) { /* M_ERROR_TERM by default */
+ if (lc->err_type == 0) { /* M_ERROR_TERM by default */
lc->err_type = M_ERROR_TERM;
}
if (lf == NULL) {
Emsg0(M_ABORT, 0, _("Close of NULL file\n"));
}
- Dmsg1(2000, "Close lex file: %s\n", lf->fname);
+ Dmsg1(dbglvl, "Close lex file: %s\n", lf->fname);
of = lf->next;
fclose(lf->fd);
- Dmsg1(2000, "Close cfg file %s\n", lf->fname);
+ Dmsg1(dbglvl, "Close cfg file %s\n", lf->fname);
free(lf->fname);
if (of) {
of->options = lf->options; /* preserve options */
memcpy(lf, of, sizeof(LEX));
- Dmsg1(2000, "Restart scan of cfg file %s\n", of->fname);
+ Dmsg1(dbglvl, "Restart scan of cfg file %s\n", of->fname);
} else {
of = lf;
lf = NULL;
lf->fname = fname;
lf->state = lex_none;
lf->ch = L_EOL;
- Dmsg1(2000, "Return lex=%x\n", lf);
+ Dmsg1(dbglvl, "Return lex=%x\n", lf);
return lf;
}
} else {
lf->col_no++;
}
- Dmsg2(2000, "lex_get_char: %c %d\n", lf->ch, lf->ch);
+ Dmsg2(dbglvl, "lex_get_char: %c %d\n", lf->ch, lf->ch);
return lf->ch;
}
void lex_unget_char(LEX *lf)
{
- lf->col_no--;
- if (lf->ch == L_EOL)
- lf->ch = 0;
+ if (lf->ch == L_EOL) {
+ lf->ch = 0; /* End of line, force read of next one */
+ } else {
+ lf->col_no--; /* Backup to re-read char */
+ }
+
}
int token = T_NONE;
bool esc_next = false;
- Dmsg0(2000, "enter lex_get_token\n");
+ Dmsg0(dbglvl, "enter lex_get_token\n");
while (token == T_NONE) {
ch = lex_get_char(lf);
switch (lf->state) {
case lex_none:
- Dmsg2(2000, "Lex state lex_none ch=%d,%x\n", ch, ch);
+ Dmsg2(dbglvl, "Lex state lex_none ch=%d,%x\n", ch, ch);
if (B_ISSPACE(ch))
break;
if (B_ISALPHA(ch)) {
begin_str(lf, ch);
break;
}
- Dmsg0(2000, "Enter lex_none switch\n");
+ Dmsg0(dbglvl, "Enter lex_none switch\n");
switch (ch) {
case L_EOF:
token = T_EOF;
- Dmsg0(2000, "got L_EOF set token=T_EOF\n");
+ Dmsg0(dbglvl, "got L_EOF set token=T_EOF\n");
break;
case '#':
lf->state = lex_comment;
}
break;
case L_EOL:
- Dmsg0(2000, "got L_EOL set token=T_EOL\n");
+ Dmsg0(dbglvl, "got L_EOL set token=T_EOL\n");
if (expect != T_SKIP_EOL) {
token = T_EOL;
}
}
break;
case lex_comment:
- Dmsg1(2000, "Lex state lex_comment ch=%x\n", ch);
+ Dmsg1(dbglvl, "Lex state lex_comment ch=%x\n", ch);
if (ch == L_EOL) {
lf->state = lex_none;
if (expect != T_SKIP_EOL) {
}
break;
case lex_number:
- Dmsg2(2000, "Lex state lex_number ch=%x %c\n", ch, ch);
+ Dmsg2(dbglvl, "Lex state lex_number ch=%x %c\n", ch, ch);
if (ch == L_EOF) {
token = T_ERROR;
break;
token = T_ERROR;
break;
}
- Dmsg1(2000, "Lex state lex_ip_addr ch=%x\n", ch);
+ Dmsg1(dbglvl, "Lex state lex_ip_addr ch=%x\n", ch);
break;
case lex_string:
- Dmsg1(2000, "Lex state lex_string ch=%x\n", ch);
+ Dmsg1(dbglvl, "Lex state lex_string ch=%x\n", ch);
if (ch == L_EOF) {
token = T_ERROR;
break;
add_str(lf, ch);
break;
case lex_identifier:
- Dmsg2(2000, "Lex state lex_identifier ch=%x %c\n", ch, ch);
+ Dmsg2(dbglvl, "Lex state lex_identifier ch=%x %c\n", ch, ch);
if (B_ISALPHA(ch)) {
add_str(lf, ch);
break;
add_str(lf, ch);
break;
case lex_quoted_string:
- Dmsg2(2000, "Lex state lex_quoted_string ch=%x %c\n", ch, ch);
+ Dmsg2(dbglvl, "Lex state lex_quoted_string ch=%x %c\n", ch, ch);
if (ch == L_EOF) {
token = T_ERROR;
break;
add_str(lf, ch);
break;
}
- Dmsg4(2000, "ch=%d state=%s token=%s %c\n", ch, lex_state_to_str(lf->state),
+ Dmsg4(dbglvl, "ch=%d state=%s token=%s %c\n", ch, lex_state_to_str(lf->state),
lex_tok_to_str(token), ch);
}
- Dmsg2(2000, "lex returning: line %d token: %s\n", lf->line_no, lex_tok_to_str(token));
+ Dmsg2(dbglvl, "lex returning: line %d token: %s\n", lf->line_no, lex_tok_to_str(token));
lf->token = token;
/*
break;
case T_INT64:
- Dmsg2(2000, "int64=:%s: %f\n", lf->str, strtod(lf->str, NULL));
+ Dmsg2(dbglvl, "int64=:%s: %f\n", lf->str, strtod(lf->str, NULL));
if (token != T_NUMBER || !is_a_number(lf->str)) {
scan_err2(lf, _("expected an integer number, got %s: %s"),
lex_tok_to_str(token), lf->str);
*
*/
/*
- Copyright (C) 2000-2005 Kern Sibbald
+ Copyright (C) 2000-2006 Kern Sibbald
This program 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 2 of
- the License, or (at your option) any later version.
+ modify it under the terms of the GNU General Public License
+ version 2 as amended with additional clauses defined in the
+ file LICENSE in the main source directory.
This program 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 this program; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ the file LICENSE for additional details.
*/
Dmsg1(400, "Want changer slot=%d\n", slot);
changer = get_pool_memory(PM_FNAME);
- if (slot > 0 && dcr->device->changer_name && dcr->device->changer_command) {
+ if (slot <= 0) {
+ Jmsg(jcr, M_INFO, 0, _("Invalid slot=%d defined, cannot autoload Volume.\n"), slot);
+ rtn_stat = 0;
+ } else if (!dcr->device->changer_name) {
+ Jmsg(jcr, M_INFO, 0, _("No \"Changer Device\" given cannot autoload Volume.\n"));
+ rtn_stat = 0;
+ } else if (!dcr->device->changer_command) {
+ Jmsg(jcr, M_INFO, 0, _("No \"Changer Command\" given cannot autoload Volume.\n"));
+ rtn_stat = 0;
+ } else {
+ /* Attempt to load the Volume */
+
uint32_t timeout = dcr->device->max_changer_wait;
int loaded, status;
if (status == 0) { /* did we succeed? */
rtn_stat = 1; /* tape loaded by changer */
}
- } else {
- rtn_stat = 0; /* no changer found */
}
free_pool_memory(changer);
return rtn_stat;
* Test program for find files
*/
/*
- Copyright (C) 2000-2005 Kern Sibbald
+ Copyright (C) 2000-2006 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
#undef VERSION
#define VERSION "1.39.10"
-#define BDATE "02 May 2006"
-#define LSMDATE "02May06"
+#define BDATE "05 May 2006"
+#define LSMDATE "05May06"
/* Debug flags */
#undef DEBUG
}
-int
-syslog(int type, const char *fmt, const char *msg)
+/* For apcupsd this is in src/lib/wincompat.c */
+#ifndef __APCUPSD__
+extern "C" void syslog(int type, const char *fmt, ...)
{
/*#ifndef HAVE_CONSOLE
MessageBox(NULL, msg, "Bacula", MB_OK);
#endif*/
- return 0;
}
+#endif
struct passwd *
getpwuid(uid_t)
struct timespec;
int readdir(unsigned int fd, struct dirent *dirp, unsigned int count);
int nanosleep(const struct timespec*, struct timespec *);
-//struct tm *localtime_r(const time_t *, struct tm *);
-//struct tm *gmtime_r(const time_t *, struct tm *);
long int random(void);
void srandom(unsigned int seed);
int lstat(const char *, struct stat *);
#define mkdir(p, m) win32_mkdir(p)
#define unlink win32_unlink
#define chdir win32_chdir
-int syslog(int, const char *, const char *);
+extern "C" void syslog(int type, const char *fmt, ...);
#ifndef LOG_DAEMON
#define LOG_DAEMON 0
#endif
+#ifndef _SYSLOG_H
+#define _SYSLOG_H
+
+#define LOG_DAEMON 0
+#define LOG_ERR 1
+#define LOG_CRIT 2
+#define LOG_ALERT 3
+#define LOG_WARNING 4
+#define LOG_NOTICE 5
+#define LOG_INFO 6
+#define LOG_LOCAL0 10
+#define LOG_LOCAL1 11
+#define LOG_LOCAL2 12
+#define LOG_LOCAL3 13
+#define LOG_LOCAL4 14
+#define LOG_LOCAL5 15
+#define LOG_LOCAL6 16
+#define LOG_LOCAL7 17
+#define LOG_LPR 20
+#define LOG_MAIL 21
+#define LOG_NEWS 22
+#define LOG_UUCP 23
+#define LOG_USER 24
+#define LOG_CONS 0
+#define LOG_PID 0
+
+
+extern "C" void syslog(int type, const char *fmt, ...);
+void openlog(const char *app, int, int);
+void closelog(void);
+
+#endif /* _SYSLOG_H */