- flags = DB_ARCH_ABS;
-
- /* Get the list of names. */
- if ((ret = dbenv->log_archive(dbenv, &list, flags)) != 0) {
- CtdlLogPrintf(CTDL_ERR, "cdb_cull_logs: %s\n", db_strerror(ret));
- return;
- }
-
- /* Print the list of names. */
- if (list != NULL) {
- for (file = list; *file != NULL; ++file) {
- CtdlLogPrintf(CTDL_DEBUG, "Deleting log: %s\n", *file);
- ret = unlink(*file);
- if (ret != 0) {
- snprintf(errmsg, sizeof(errmsg),
- " ** ERROR **\n \n \n "
- "Citadel was unable to delete the "
- "database log file '%s' because of the "
- "following error:\n \n %s\n \n"
- " This log file is no longer in use "
- "and may be safely deleted.\n",
- *file, strerror(errno));
- aide_message(errmsg, "Database Warning Message");
- }
- }
- free(list);
- }
-}
-
-/*
- * Manually initiate log file cull.
- */
-void cmd_cull(char *argbuf) {
- if (CtdlAccessCheck(ac_internal)) return;
- cdb_cull_logs();
- cprintf("%d Database log file cull completed.\n", CIT_OK);
-}
-
-
-/*
- * Request a checkpoint of the database.
- */
-void cdb_checkpoint(void)
-{
- int ret;
-// static time_t last_run = 0L;
-
- /* Only do a checkpoint once per minute. */
-/*
- * Don't need this any more, since the thread that calls us sleeps for 60 seconds between calls
-
- if ((time(NULL) - last_run) < 60L) {
- return;
- }
- last_run = time(NULL);
-*/
-
- CtdlLogPrintf(CTDL_DEBUG, "-- db checkpoint --\n");
- ret = dbenv->txn_checkpoint(dbenv,
- MAX_CHECKPOINT_KBYTES,
- MAX_CHECKPOINT_MINUTES, 0);