Friday, May 27, 2011

Simle logs backup script

[root@mywebServer cron.daily]# vim httpdbackup
#!/bin/sh
cd /var/log/httpd/
tar -zcf httpd.tgz .
mv httpd.tgz /home/public/backup/
cd /home/public/backup
ls -la | mail -s "backup $HOSTNAME -'date'" myEmailID@companyDomainName.com