ejhildreth: @SkryFOX12 Ouch. Luckily the actions of the few won't permanently tarnish the reputation of the whole.
backups
Objective:
- Create a limited mySQL user account (e.g. Read-Only) to use in the batch file to follow the The Principle of Least Privilege methodology
- Place multiple mySQL database backups in a specified folder
- Add a timestamp to the mySQL dump file to easily distinguish between versions
- Have multiple mySQL databases get backed up at a specified time
One of the "best" best practices is to backup any important data that you do not want to loose. This is especially important when you are storing a bunch of other people's data in a database. Problem is, if it is something that we have to think about, it just isn't going to happen. Luckily, all modern operating systems have the ability to run user generated scripts to help automate this task.
Problem: Having a Drupal site automatically run the cron.php script and automatically backup a mySQL database at regular intervals on a Slicehost slice that is running Ubuntu.
Solution: Shell Scripting and Crontab
Turns out, this wasn't so much of a problem after all and it has a really straightforward solution. Since I am using Ubuntu, it already has cron functionality built into it. To tap into this functionality, it is as easy as editing a text file and telling the system to tun the tasks you want (including shell scripts).
MySQL cron backup step-by-step:
