Documentation for Confluence 5.8 (Server).
Documentation for Confluence Cloud and earlier versions of Confluence is available too.

Skip to end of metadata
Go to start of metadata
These scripts are user-submitted and should be used with caution as they are not covered by Atlassian technical support. If you have questions on how to use or modify these scripts, please post them to Atlassian Answers. Feel free to submit new scripts or post updates by logging in and adding them to the page as a comment. 

(warning) The information on this page does not apply to Confluence Cloud.

Delete Old Backups - Wscript Script On Windows

This script examines backup filename and deletes them if necessary, it may need to be edited.

Delete Old Backups - Basic Bash Script For Linux

Old XML backups can be deleted automatically by inserting a nightly or weekly automation script or cron similar to the following:

Or, using the older form of the tail command if your system does not support the standard form:

Delete Old Backups - Advanced Bash Script For Linux

Old XML backups can be deleted automatically by inserting a nightly or weekly automation script or cron similar to the following. Set the BACKUP_DIR and DAYS_TO_RETAIN variables to appropriate values for your site. Between runs, more files than DAYS_TO_RETAIN builds up.

Manual Database & Home Backup - Bash Script For Linux

This backs up a mySQL database and the Confluence home directory.

Backup by Date - Postgres

Related Topics


  1. The Backup Manager plugin is an easy way to set-up automatic pruning of your backups folder, etc.

  2. I adjusted the Linux script above to what I think is a bit more generic, readable and works on Mac and Linux. This one only backs up the confluence-home directory so you just have to add back the database export if you want that:

  3. I made this set of scripts for daily automatic as well as single manual backups in our environment. Might come in handy for others as well. They might not be the most elegant scripts in the world, but they work. Improvement suggestions are welcome! (smile)

    Environment: CentOS, MySQL, Confluence Standalone 3.4.9

    EDIT: Forgot to mention that all these scripts also assume Confluence is a system service as per this guide.

    Confluence backup script
     Click here to expand...
    Confluence backup script for install directory, data directory and database
    Confluence daily backup routine

    If you want to use the above script as a subroutine in a daily backup script, you can do so with the following cron script:

     Click here to expand...
    Confluence daily backup cron script
    Cleanup script

    In order to conserve storage space, I also made a script for cleaning up old backups.

     Click here to expand...
    Confluence cleanup script for old backups
    1. These scripts work great for me. Just replace the pg_dump with mysqldump as following

      And create ~/.pgpass to allow the password to be entered automatically.

      The DATA is the confluence home directory.