Ignacio Valdes Implementation Log/Episode31
From VistApedia
(Redirected from Episode31)
Ignacio_Valdes_Implementation_Log
I've changed over to journaling and now have a backup system to a USB drive. Use the parent posting terminal session to take down the system, then where it has the backup command, instead do: mupip set -journal="enable,on,before" -region "*" then bring the system back up as above. Here is a quickie backup script called nightlybak.sh that is self explanatory in the comments on how to set it up using cron to run every night at 5. This does not require taking down the system. It can be run with or without cron. Remember to chmod +x to make it executable on Linux. Good compression is achievable with this via tar -czf, I was able to get about a 70% file size reduction. No guarantees on this, use at your own risk, has been tested some. You should encrypt the USB drive prior to backing up to prevent patient data turning up somewhere it should not but right now I do not know how to format a USB drive encrypted and using Linux. Can anyone help with that? Comments? Thoughts? Rotten tomatoes? -- IV ******* begin script ******* #!/bin/bash # nightlybak.sh # Quickie daily backup, should be run with cron. # Use crontab -e with the follwing in the crontab file: # MAILTO=youremail@somewhere.org # 00 5 * * * /home/vista/EHR/nightlybak.sh # # The above crontab will run every day at 5 and will run the script below # if placed in the proper subdirectory. This will create a backup on the primary # machine, tar it and compress it, then copy it to an external media. # It will then email that it has done it. # Caveats: This has very little error-checking for media present and writable. # This has been somewhat tested on Fedora 9 Linux. # No guarantees or warranties expressed or implied, use at your own risk. # Author: Ignacio Valdes, MD, MS # 12/18/08 # FN=/home/vista/EHR/g/backup/mumps.dat.bak_$(date +%Y%m%d) TGZFN=/home/vista/EHR/g/backup/mumps.dat.bak_$(date +%Y%m%d).tgz /usr/local/gtm/mupip backup -database -nojournal "*" $FN tar -czf $TGZFN $FN # copy to previously mounted removable media. cp $TGZFN /media/My\ Book/ # Clean up a little bit. rm $FN ****** End Script ****** All rights reserved - Ignacio Valdes