Backing up cPanel 11 hosted account with wget and dav/rsync
Posted by Admin • Thursday, August 21. 2014 • Category: Linux
I want to back up my hosting account regularly by retrieving everything onto my box somewhere else (my home server). By regularly, I mean every day. I want this to happen automatically. cPanel makes that hard to do, but there is always a way to script things.
First, let's break down what we want to back up:
First, let's break down what we want to back up:
- Files
- Databases and email forwarders
- FTP account using recursive wget (create an FTP account with required access and teach an ftp client of your choice to recursively transfer everything. Hopefully this client skips unchanged files)
- WebDAV using rsync (this is what I'm using). Just mount, back up, unmount
- Submit your login to the log-in page and save cookies
- Parse the resulting file, find the backup link which includes your session name in the URL and hit that
- Only accept .gz files (DB backups and email stuff), but avoid hitting /logout, and don't start spidering the entire website
Continue reading "Backing up cPanel 11 hosted account with wget and dav/rsync"