PHP Script for Automated Backup
Requirements:
1. PHP5 with PECL-SSH2 enabled
2. The SSH2 wrapper library (http://www.seoegghead.com/software/ssh2-php-wrappers.seo)
3. The killer script:
require_once('SSH2.php');
$s = new SSH2('MYSERVER');
$s->loginWithPassword('MYLOGIN', 'MYPASSWORD');
$_buf = $s->execCommandBlocking('tar cvf - /www/foo_com/');
file_put_contents('foo_com_backup_' . date('Ymd'), $_buf);
Result: Priceless peace of mind knowing that there is a script doing stuff humans should not supposed to regularly do.
Source:
http://www.phpclasses.org/blog/post/88-Automating-Backup-Tasks-Remotely-with-PHP-and-PECL-SSH2-extension.html
<< Home