Skip to content

Commit

Permalink
MSSQL Incremental Backups not restorable to files
Browse files Browse the repository at this point in the history
Fixes #515: MSSQL Incremental Backups not restorable to files

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
sacculus authored and Marco van Wieringen committed Oct 7, 2015
1 parent e007f33 commit 4f90c60
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/win32/plugins/filed/mssqlvdi-fd.c
Expand Up @@ -487,16 +487,17 @@ static bRC startBackupFile(bpContext *ctx, struct save_pkt *sp)
}

now = time(NULL);
bstrftime(dt, sizeof(dt), now, "%Y%m%d-%H%M%S");

switch (p_ctx->backup_level) {
case L_FULL:
Mmsg(fname, "/@MSSQL/%s/%s/db-full", p_ctx->instance, p_ctx->database);
Mmsg(fname, "/@MSSQL/%s/%s/db-%s-full.bak", p_ctx->instance, p_ctx->database, dt);
break;
case L_DIFFERENTIAL:
Mmsg(fname, "/@MSSQL/%s/%s/db-diff", p_ctx->instance, p_ctx->database);
Mmsg(fname, "/@MSSQL/%s/%s/db-%s-diff.bak", p_ctx->instance, p_ctx->database, dt);
break;
case L_INCREMENTAL:
bstrutime(dt, sizeof(dt), now);
Mmsg(fname, "/@MSSQL/%s/%s/log-%s", p_ctx->instance, p_ctx->database, dt);
Mmsg(fname, "/@MSSQL/%s/%s/db-%s-log.trn", p_ctx->instance, p_ctx->database, dt);
break;
default:
Jmsg(ctx, M_FATAL, "Unsuported backup level (%c).\n", p_ctx->backup_level);
Expand Down

0 comments on commit 4f90c60

Please sign in to comment.