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.
[Edit]
symcbean: could you list what further information you need from me in order to give 'more tailored advice' ?. In terms of budget, lets just say that it zero. SO I am unable to forkout much more apart from the (dedicated) server hosting + the Amazon S3 storage. That is also, why I will need to either use open source software or write my own bash script using the available tools on Linux.
It is a new website, and initially, the backed up data is likely to be under 1 Gb, but I fully expect the data to be growing by at least around 100Mb a day. This very quickly adds up if I am doing full backups daily and sending the backup file(s) by wire to Amazon S3.
I suggested incremental backups because I want to save on the bandwidth costs (not to mention server load) associated with transmitting potentially, several Gigabytes of data every day.
Also, no one (so far), has explained how to rotate between the [hourly?], daily, weekly and monthly backups.
There is a lot of (wildly differing) information/opinion out there - regarding backups. I just want to know what is the recommended 'best practice' regarding my particular situation as described above.
If further info is required in order to be able to suggest a more 'tailored recommendation', let me know so I can provide the required information.