This is a small script I created to backup my MySQL database. My hoster offers a free online storage service for VPS customers called "Stack". Stack has 1TB of storage! You can also access Stack via Webdav. That's why I created a script that dumps all my databbases, gzips them and uploads them via webdav to Stack.
This script could of course have been written using only bash. However I find the syntax of bash confusing and I don't like to constantly pipe variables and command outputs to eachother. I wanted to use a proper programming language. I have a dislike for Python and I have never written a Perl program before, so I thougth this would be a fun learning expierence.
(I take no responsibility if you use my script and something goes wrong)
- Make sure you have all modules installed
- Rename
config.sample.yaml
toconfig.yaml
- Fill out
config.yaml
with your information - Create a cron or run
backup.pl
- YAML::XS
- DBI
- DBD::mysql