Created
May 14, 2018 22:01
-
-
Save bluengreen/08eda779967dbb0a1d99cbaecdfcc00a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # settings the paths | |
| mirthPath="/opt/mirthconnect/" | |
| backupPath="/home/mirth/backups/" | |
| scriptPath=`pwd`"/" | |
| vDate=`date --date 'yesterday' +%Y-%m-%d` | |
| # generating console command | |
| echo exportcfg ${backupPath}mirth_backup-${vDate}.xml > ${scriptPath}backup_cmds | |
| # run backup | |
| ${mirthPath}Mirth\ Connect\ CLI -s ${scriptPath}backup_cmds | |
| # generating checksum | |
| cd ${backupPath} | |
| md5sum mirth_backup-${vDate}.xml > mirth_backup-${vDate}.md5 | |
| md5sum mirth_backup-${vDate}.xml >> checksums.md5 | |
| # compress backup with 7z | |
| 7z a -t7z -mx=9 ${backupPath}mirth_backup-${vDate} ${backupPath}mirth_backup-${vDate}.* && rm ${backupPath}mirth_backup-${vDate}.xml ${backupPath}mirth_backup-${vDate}.md5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment