By default, Confluence runs its daily backup at 2.00 AM. You can configure Confluence to perform the backup at a time that is best suited to you or your organisational needs.
Confluence uses Quartz for scheduling periodic jobs. To change the time of your daily backup, you will need to edit the Quartz configuration.
To change the time of your daily backup
|
For example, to set the new time to twenty past ten PM, change the string to
'0 20 22 * * ?'.
If you wanted to back up only once a week, for example, at midnight on Sundays, you would change the string to '0 0 0 ? * SUN'.
For complete details on the formatting of the cron string, please see http://www.opensymphony.com/quartz/api/org/quartz/CronTrigger.html.
The recommended approach for backing up a clustered instance of Confluence is to use your database backup tools to backup the database, and backup the home directory of one node in the cluster. You can then disable the automatic Confluence backup, which is not suitable for large instances which clusters typically are.
The remainder of this section covers the unusual case where you want to change the configuration of the automatic backup in a cluster.
Scheduled tasks in a cluster are configured to run either on every node (like indexing), or on just a single node. The daily backup is configured to run on a single node, but this is easy to change if you understand how Confluence ensures these jobs only execute once.
To ensure the daily backup only starts on one node, Confluence uses a locking system. The first node to kick off the scheduled backup (even if it is only several milliseconds ahead) will acquire a lock which prevents subsequent nodes from running the backup. The lock is specific to the task and the scheduled time the task was due to start at. Later nodes checks for an existing lock with the backup task and the time they have scheduled, and skip the job if it already exists.
There are three important consequences of this:
None of these approaches is recommended. Automatic backup is not suitable for instances with large amounts of data, and clusters are not generally small instances of Confluence. The recommended approach is to use a database backup tool to backup the database, and a filesystem backup tool to save the Confluence home directory (preferably at the same time).
The example below shows how to a backup job to be executed on Node A at 2:00 AM and on Node B at 3:00 AM. You can use this configuration to get a backup on both nodes, as long as your backup always completes within 1 hour. (Check the timestamps on the previous backup ZIP files to verify this.)
Node A schedulingSubsystemContext.xml (see above for full configuration)
...
<value>0 0 2 * * ?</value>
...
|
Node B schedulingSubsystemContext.xml
...
<value>0 0 3 * * ?</value>
...
|
The default configuration in a cluster is the same as a normal instance of Confluence: the backup job is enabled for 2 AM on all nodes. As discussed above, the first node to acquire a lock on this job will execute it, so the backup will be done potentially by a different node every time.