Schedule JasperServer Repository Export
Export of JasperServer Repository :
Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.
- Access the server where jasperserver is installed. It can be on your local machine as well as on remote server. If the jasperserver is installed in local machine then run command in command prompt. Else connect to the remote server through putty and run commands.
- Jasperserver provide us with the import-export utility by using which export of any kind of data on server can be taken.
- The import and export utilities are shell scripts located in the:
<js-install>/buildomatic folder.
- Windows: <js-install>\buildomatic\js-import.bat
<js-install>\buildomatic\js-export.bat - Linux: <js-install>/buildomatic/js-import.sh
<js-install>/buildomatic/js-export.sh
More information about jasper utility and the command can be found at “http://community.jaspersoft.com/documentation/jasperreports-server-administration-guide/v550/import-and-export-through-command-line”
- JasperReports server should be stopped when using the import and export utilities. This is very important for the import utility to avoid issues with caches, configuration, and security.
- Go the path <js-install>/buildomatic and Run the command :
Unix:
js-export.sh –uris /public/ Reports –output-zip E:\document \report.zip
Windows:
js-export.bat –everything –output-zip E:\document \report.zip
- After complete execution of above command you’ll be able to get the required export in the given directory with the given output file name.
- Next task is to create the script which we can run on server. Here is an example of shell script which can be run on unix server.
- In this script following variables are declared:
# Path to buildomatic directory of Jasperserver that contains the js-export script: JASPER_BUILDPATH=/opt/jasperreports-server-6.3.0-bin/buildomatic/
# URI of Jasper repository folder to be dumped:
REPO_REPPATH=/public/Reports
# Destination directory for backup files:
DUMP_DIR=/home/server/JasperBackup/
# Destination output file name for backup file:
OUTPUT=repo_bkp
# export of the jasper repository
DATETIME=date +%Y%m%d%H%M%S
Next ,
cd ${JASPER_BUILDPATH} has been used to go to the js-install path.
Where the export command can be run.
./js-export.sh –uris ${REPO_REPPATH} –repository-permissions –output-zip ${DUMP_DIR}${OUTPUT}_${DATETIME}.zip
In this,
if [ $? -eq 0 ]; then
echo “Backup is taken Successfully. Backup File – ${DUMP_DIR}${OUTPUT}_${DATETIME}.zip”
else
echo “Backup Failed. Please check the above log for any errors.”
Fi
We are writing in the log file on the successful/unsuccessful completion of the backup.
We can run this script on server with command “sh script_name.sh”.
Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.
Schedule Export of JasperServer Repository :
- Crontab syntax :
A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval. - Type in ‘Crontab -e’ in server, following screen will appear:
Nano editor will open
Type in there:
/5 * * * /home/server/JasperBackup/jasper_backup.sh >> /home/jasper/JasperBackup/log.txt 2>&1
Here we are scheduling the execution of “jasper_backup.sh” file in every 5 minutes. You can schedule as per the requirement.
Best Open Source Business Intelligence Software Helical Insight is Here
A Business Intelligence Framework
Thank You
Nisha Sahu
crontab export export utility import Import and Export through the Command Line Jaspersoft Import or Export Jasper Reports jasperreports ultimate guide jasperserver import-export key jasperserver repository jaspersoft import report or Migrate Advanced Reporting Content jaspersoft repository export Schedule JasperServer Repository Export tibco jaspersoft platform support guide unix windows