Hi i tried opening this link http://www.bradymd.com/appliance/manual9/#__RefHeading__5628_695817034
to get more info on the Ubuntu backup script. I am looking for a script or tool that can do backups of OpenEMR + mysql backups on a weekly basis. Or is there a modified version of the backup.php script that can run on cron?
I used the script provided, it seems to be working, but for some reason the following code is throwing me a syntax error: bad loop for variable:
Delete the oldest allowed historical backup and rename the others to make room for a new one.
rm -f $SHORT.$NUMBACKUPS.tar.gz
for ((I=NUMBACKUPS; I > 1; I=I-1)); do( syntax error from this line)
J=$((I-1))
if [ -e “$SHORT.$J.tar.gz” ]; then
mv $SHORT.$J.tar.gz $SHORT.$I.tar.gz
fi
done
I commented it out and the backup is successful without it, but I would like to be able rename the older backups.
I will try to continue to debug, but if anyone has run into this and has the solution, it would be greatly appreciated. Thanks!
FYI @stephenwaite@brady.miller , I like renaming previous backups to include the date it was backed up. If anyone wants to use this python script to rename to include date, I posted it on Github. I set the backup script to run nightly using Crontab and included a python command to execute the python script after the backup completes.