Automatic cPanel Backup

I read this great post today that shows how to automatically backup cPanel with PHP and a cron job and FTP the backup to a remote host. The guy that wrote this recommends that you keep the file on the server you want to backup, but I have like 50 cPanel sites and so I thought it would be better just to keep all of the login info in one file on my laptop and run it with my local version of PHP (set up WAMP or XAMPP to run php locally on windows). I modified the script by adding an array of sites and then the script loops over each set and backs up that site. Pretty awesome way to do this and the neat thing is that it uses functionality that is built into cPanel to do it.

Here's the code:

So I use this straight from the command line on my local computer and plan to set it up with Windows Scheduler to automate this about every 3 to 5 days. I feel a lot better about having a file with all of my cpanel passwords on my computer rather than on a web server. I think some of the variables I set up like scp usage and the ftp directory are newer so if you have an old version of cpanel then it might not support that. Hope this helps someone else to backup cpanel automatically.