I have a Media Temple (DV) server with many domains on it. I'm already using a simple script within each domain account to backup httpdocs files and mysql databases to a private directory as gz files. I would now like to run a second script on each domain that copies the gz files to an Amazon S3 bucket, then deletes the gz files from the server, and deletes any from the S3 bucket that are older than N days.
*The script should be easily reused on any of my domains by simply replacing a few variables.
*The script should be able to run via cron each night.
*Would prefer a script that uses existing server resources, but any new resources that are installed to the server must work with existing and future domains.
There is existing code out there for this, so I know it's not overly complicated, I'm just not strong enough a coder to adapt them to my needs. Use of existing code is fine as long as it meets my needs.