From: James Harper Date: Sun, 16 Oct 2011 11:34:01 +0000 (+0200) Subject: Ensure log files in first backup are restored X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2a18444bffdf00cb08e9f66bf72edb5edce41b7a;p=bacula%2Fbacula Ensure log files in first backup are restored --- diff --git a/bacula/src/win32/filed/plugins/exchange-fd.c b/bacula/src/win32/filed/plugins/exchange-fd.c index 8e654fb837..1fd0541375 100644 --- a/bacula/src/win32/filed/plugins/exchange-fd.c +++ b/bacula/src/win32/filed/plugins/exchange-fd.c @@ -65,6 +65,7 @@ static bRC startRestoreFile(bpContext *ctx, const char *cmd); static bRC endRestoreFile(bpContext *ctx); static bRC createFile(bpContext *ctx, struct restore_pkt *rp); static bRC setFileAttributes(bpContext *ctx, struct restore_pkt *rp); +static bRC checkFile(bpContext *ctx, char *fname); static pFuncs pluginFuncs = { sizeof(pluginFuncs), @@ -82,7 +83,8 @@ static pFuncs pluginFuncs = { endRestoreFile, pluginIO, createFile, - setFileAttributes + setFileAttributes, + checkFile, }; extern "C" { @@ -512,3 +514,12 @@ static bRC setFileAttributes(bpContext *ctx, struct restore_pkt *rp) _DebugMessage(100, "setFileAttributes\n"); return bRC_OK; } + +static bRC checkFile(bpContext *ctx, char *fname) +{ + exchange_fd_context_t *context = (exchange_fd_context_t *)ctx->pContext; + _DebugMessage(100, "checkFile\n"); + /* previous files are always Seen */ + return bRC_Seen; +} + diff --git a/bacula/src/win32/filed/plugins/storage_group_node.c b/bacula/src/win32/filed/plugins/storage_group_node.c index e4a8fcdce0..a194e5448f 100644 --- a/bacula/src/win32/filed/plugins/storage_group_node.c +++ b/bacula/src/win32/filed/plugins/storage_group_node.c @@ -168,7 +168,7 @@ storage_group_node_t::startBackupFile(exchange_fd_context_t *context, struct sav { if (GetFileTime(handle, NULL, NULL, &modified_time) == 0) { - //_JobMessage(M_WARNING, "Could check last modified date for '%S' (0x%08x), including anyway\n", tmp_logfile_ptr, GetLastError()); + //_JobMessage(M_WARNING, "Could not check last modified date for '%S' (0x%08x), including anyway\n", tmp_logfile_ptr, GetLastError()); include_file = true; } } @@ -188,6 +188,8 @@ storage_group_node_t::startBackupFile(exchange_fd_context_t *context, struct sav logfile_ptr += wcslen(logfile_ptr) + 1; //_DebugMessage(100, "Including file %S\n", logfile_ptr); } +#if 0 +/* this is handled via checkFile now */ else { if (context->accurate) { @@ -198,6 +200,7 @@ storage_group_node_t::startBackupFile(exchange_fd_context_t *context, struct sav delete tmp; } } +#endif if (handle != INVALID_HANDLE_VALUE) CloseHandle(handle);