#!/bin/sh # Script to remove the older Confluence backup files. # Currently we retain at least the last two weeks worth # of backup files in order to restore if needed. BACKUP_DIR="/data/web/confluence/backups" DAYS_TO_RETAIN=14 find $BACKUP_DIR -maxdepth 1 -type f -ctime +$DAYS_TO_RETAIN -deleteConfluence backs up the site to a
backupssubdirectory. You can tell where that is (and change it if you want) under your
Administration -> Daily Backup Adminpage.
I put this script on my Linux box in the
/etc/cron.weeklydirectory. Since I run the script only weekly, more files will build up than defined by the
DAYS_TO_RETAINvariable, but my Confluence site is small and this doesn't matter to me. If your site is larger, you might want to put the script under
Confluence uses Quartz to schedule backups, so if you want to change the time from 2 a.m. (or make backups less or more frequent), see the Confluence Changing time of Daily Backup page for instructions.