User Tools

Site Tools


Backup Error on Mac OS X

The automatic GECAMed backup process produces some errors on Mac OS X.
Although the database and file backups are done, the old backups aren't deleted afterwards, which can lead to a full disc / empty disc space. What again will prevent GECAMed from doing new backups.
Also the dicom and letter backups aren't done automatically, anymore. The manual backup via GECAMed Client is still working.

The Bug will be fixed in the next release (>= 2.01.03).
Until then you will need to do the backups and delete the old backups regularly. You can do this manually or with a script.

Here's a script example, how to backup the gecamed files:



FILE_NAME=gecamed_$(date "+%Y_%m_%d_%H_%M_%S")

zip_gecamed_data () {
  # v is for verbose, to show which files are added to the zip file.
  #   Removing it will not change the bahaviour, you will simply have less output 
  #   on the console.
  # 9 is the degree of compression, where 9 is the highest and 0 is no compression.
  #   Having no compression will make the zipping faster, but enlarges the size of 
  #   the zip file.


# backup the attached patient files
# outcommented, because this backup still works
#zip_gecamed_data "patient_files" "filezip"

# backup the letter templates
zip_gecamed_data "template_dir" "lettertemplatezip"

# backup the patient DICOM files
zip_gecamed_data "dicom_dir" "dicomzip"

And here an example, how to delete the oldest backup files:



delete_oldest () {
  ls -1t *.$FILE_EXTENSION | while read line
    if [[ $CURRENT -gt $MAX ]]
      echo "deleting: $line"
      rm $line

delete_oldest pgdump $MAX_FILES
delete_oldest filezip $MAX_FILES
delete_oldest dicomzip $MAX_FILES
delete_oldest lettertemplatezip $MAX_FILES

GECAMED_DATA_DIR defines the folder, where the files are stored. You can look the folder up in the file “” under “«GECAMed Install Dir»/jboss-4.0.5.GA/server/default/conf”. The default is “/Applications/GECAMed/gecamed_data”
MAX_FILES defines, how many backups of each type shall be preserved (in this case 10).
BACKUP_DIR defines the folder, where the backups are stored. The default is /Applications/GECAMed/gecamed_backup. This folder can be looked up in “” as well.
Make sure you have enough rights to list and delete these files. You might have to call the script as root (using sudo).

To automatically execute these scripts. you can use crontab or a launch daemon.

faq/mac/backup_error.txt · Last modified: 2015/01/23 14:06 by ferringj