Alternate Backup Method

aperezcrespo wrote on Wednesday, August 08, 2007:

Hi
  Could someone plop this into the contributions directory as an executable script?

#Dump and Compress Databases
mysqldump -u root -h localhost openemr | gzip -9 > openemr.sql.gz
mysqldump -u root -h localhost gacl | gzip -9 > gacl.sql.gz
pg_dump openemr -f sql-ledger.tar -F T -U sql-ledger

#Email the backups
email aperez@myrealbox.com -s "OpenEMR Backup" -f aperez@myrealbox.com -n "OEMR Administrator" -b -a openemr.sql.gz,gacl.sql.gz,sql-ledger.tar

This is my way of getting the files out of the office.  Way too many of my clients leave their backups in the office, so I worked out this solution.  This makes sure the data is out of the office and somewhere safe.

download the email utility from here http://email.cleancode.org./?pid=download and install.
Modify the email addresses, add any passwords required and it should work just fine.
All you have to do is cron the script.

Hope this helps
Alfonso

duanemorrow wrote on Wednesday, August 15, 2007:

Does this encrypt the text from the dumps? Hate to send email with medical info that has not been encrypted.
What about the documents directory? The practice that I use openemr at scans in all medical records/labs/xrays/etc. This directory is becoming huge. Does anyone have a better idea about backing up that directory?

aperezcrespo wrote on Wednesday, August 15, 2007:

No it doesnt.  But that should be easy to do.  In fact if you look at the backup script (located in contrib/util) one should be able to borrow alot from there to improve this script.  This was just a simple script that (at the moment) was a simple solution to a silly situation that clients put themselves into by not getting their backups off-site.

Thanks
Alfonso

andres_paglayan wrote on Wednesday, August 15, 2007:

super easy with cript,
(do man crypt)

you can add it at the end of the file creation,

to move the files out to another server,
rather than email, use rsync

also, some clients like the "burn a dvd and take it home" option
with a combination of
mkisofs
growisofs
and cdburn

you can have your server poping up a backuped DVD
every morning when you walk in,

aperezcrespo wrote on Wednesday, August 15, 2007:

Thanks for the tip.  I will test the cript option.  As soon as I update and test it, I will repost it. 
Not all clients have the option of second server for rsync.  Also I had a client who lost everything in a fire which occured before he walked in.   I just want a sure way of getting the data off the facility and avoid the loss of any data.

Thanks
Alfonso

andres_paglayan wrote on Thursday, August 16, 2007:

is crypt, actually, transposing i for y is due to latin background, ;^)
if you know exactly what you whant to achieve,
and you can print it line by line,
e.g.
1./ get mysql database
2./ get postgres database
3./ get images,
4./ tarbal the whole enchilada,
5./ encrypt it
6./ put it somewhere

also bear in mind that for a very entry level remote backup,
a $100 second hand PiV at geeks.com
and a dsl connection will do,
this way you can run rsync, database replication,
and save a lot of traffic,