2 # backups an openemr system and burns a cd
10 workdir
='/var/tmp/backups/'
11 tempdir
='/var/tmp/isos/'
12 installdir
='/var/www/openemr'
13 newerthan
='2005-01-01'
14 #newerthan is a workaround for when your media gets full,
15 #re-edit this file and change the date to the last succesfull cd copy
17 # a name for the file that is unique of that day
20 #get the content from the mysql database
21 mysqldump
-u ${dbuser} -p${dbpass} --databases ${db} > ${workdir}${file}.sql.bak
24 bzip2 ${workdir}${file}.sql.bak
26 #get the content from the postgres database
27 pg_dumpall
-U ${pguser} > ${workdir}${file}postgres.bak
30 bzip2 ${workdir}${file}postgres.bak
32 # get all the files on the site
33 # we are using bzip2 here
34 tar -N ${newerthan} -jcf ${workdir}${file}openemr.tar.bzip2 ${installdir}
38 mkisofs
-J -R -V ${label} -o ${tempdir}image.iso ${workdir}
41 cdrecord
-dao -v -data -eject ${tempdir}image.iso
43 #delete the original files