Commit 5db0f038 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(cache_sync): Store the previous backup file.

parent 22762253
/*
* $Id: dbck-cache.c,v 0.33 1998/08/07 23:07:01 ceder Exp $
* $Id: dbck-cache.c,v 0.34 1998/10/11 17:20:01 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -33,7 +33,7 @@
*/
static const char *
rcsid = "$Id: dbck-cache.c,v 0.33 1998/08/07 23:07:01 ceder Exp $";
rcsid = "$Id: dbck-cache.c,v 0.34 1998/10/11 17:20:01 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -581,6 +581,15 @@ cache_sync(void)
if ( is_clean(param.datafile_name) )
{
if (is_clean(param.backupfile_name))
{
if (rename(param.backupfile_name,
param.backupfile_name_2) != 0)
{
log("pre_sync: can't do extra backup.\n");
}
}
if ( rename(param.datafile_name, param.backupfile_name) != 0 )
log("WARNING: cache_sync: can't backup.\n");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment