PHP script to backup apache configuration, MySQL databases, and website files to AWS S3.
This project comes from a need for a backup solution for a server I was running. I needed daily backups that were off-site and needed some kind of encryption. I found out how cheap AWS S3 storage was and decided to try it out. I wrote the simple PHP script below that will backup the apache configuration, the MySQL databases, and the website files. The script starts by compressing everything into encrypted 7z files, then proceeds to do maintenance by deleting old files, and finally sends the files AWS.