I am running a LAMP website on Linux 10.0.4 LTS. I am a newbie sysadmin (I am a developer though) and I am seeking some advice on how best to implement backup for my website. My database is mySQL and ALL my database tables use the InnoDb database engine.
These are the requirements for the backup I want to implement:
Incorporates incremental and full backups of mysql database I would like to have hourly incremental backups, but also daily, weekly and monthly backups But it is not clear in my mind what rotation to use for these various backup datasets - and also how to manage them (and more importantly, how to restore the database from a set of full/incremental backups for a date)
I would like to compress and encrypt the data, so that I can store it remotely (Amazon S3)
I want to have this fully automated (i.e. run as a cron job).
Note: My server is 'headless' in that it has no X windowing or other GUI installed, so I am thinking of implementing the backup us a bash script. Alternatively, if there is software out there that can help me run these kind of backup, then it needs to be able to be run from the command line.
The items I need to backup are:
- mysql database
- website files (in a specified folder. Ideally, I would like to leave out some files that are autogenerated)
- configuration files
- miscellaneous data files in different folders
Here are my questions:
Is there existing software out there that I can use to do this, or do I need to write my own (bash script)?
What is the recommended backup strategy to use (in terms of what is run hourly, daily, weekly etc), and how to restore the website from a particular point in time?
If I have to write my own bash script (being a bash scripting newbie as well), I will be grateful if someone could provide a skeleton script to help me get started.