#!/bin/bash
#This scripts requires s3cmd installing to work
#cPanel backups are stored in /backup - so lets issue the s3cmd to put the content of the folder to the s3://[bucketname]
s3cmd put /backup s3://bucketname/backup/ -r
# script to send simple email
SUBJECT="S3 Backup complete"
EMAIL="test@test.com"
EMAILMESSAGE="/tmp/emailmessage.txt"
echo "This is an automated email - do not reply.">$EMAILMESSAGE
echo "==========================================">>$EMAILMESSAGE
echo " ">>$EMAILMESSAGE
echo "cPanel accounts have been ">>$EMAILMESSAGE
echo "successfully backed up to the Amazon S3 ">>$EMAILMESSAGE
echo " ">>$EMAILMESSAGE
echo "==========================================">>$EMAILMESSAGE
# send an email using /bin/mail
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE
This is a shell script to upload a directory to amazon S3 - requires s3cmd installing.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.