Backing Up JasperServer in Linux

This is a sysadmin how-to for backing up JasperReports Server (formerly JasperServer) and it's database (MySQL only for now).

I wrote a fairly robust script to achieve this task. It will read the database configuration from your default_master.properties file, work with several versions of JasperServer, delete old backups, write to the syslog and export the repository contents to file.

First drop my backup script into your \buildomatic folder if you're using 4.0 and abovie, 3.7 and below put in your /scripts folder.

Once the script is in place edit the variables at the top of the script:

This is to signify that you're using JasperServer 3.7.1 and below:
IS_PRE_4=false

This is a name for the product:
PRODUCT_NAME="JRS-4.0-Pro"

This is where backups will be stored:
BACKUP_DEST="/home/ernesto/Dropbox/Backups"

This will delete old backups if set to true
DELETE_OLD=true

How many days to keep old backups
DAYS=120

Now add it to your crontab. I will do it once a week in a lazy manner so will add the script to vim /etc/cron.weekly/js-backups

#!/bin/bash
/usr/local/jaspersoft/jasperserver4/buildomatic/js-backup.sh


The script will log to /var/log/messages:


The output files will look like this, I chose to stick them in my Dropbox folder for off-site backups:










You can download the script from this jasperforge forum post or view it below:

Comments

Anonymous said…
Thanks for this. It sure saved me some time :)

Popular posts from this blog

Dealing with Nested Documents in MongoDB and Talend (aka Baking a Cake)

Add sbin to user PATH in Debian

Batch convert Asterisk GSM WAV files to mp3