Amazon S3 I wrote this HOW to on DirectAdmin Forum Guide is for CENTOS 6.x x32 or x64 yum install s3cmd -y - If you can't install s3cmd then please follow the instructions
cd /etc/yum.repos.dtouch s3cmd.repo
nano s3cmd.repo
COPY THE CODE BELOW -
# Save this file to /etc/yum.repos.d on your system
# and run "yum install s3cmd"
#
name=Tools for managing Amazon S3 - Simple Storage Service (RHEL_6)
type=rpm-md
baseurl=http://s3tools.org/repo/RHEL_6/
gpgcheck=1
gpgkey=http://s3tools.org/repo/RHEL_6/repodata/repomd.xml.key
enabled=1Try Above YUM Command again - This time it will install S3CMD, Once installation is completed try running the following command - It will configure your S3CMD using your AMAZON KEY AND Access ID.
Code:
s3cmd --configureOnce above is done - Create another file for example in /home/admin/user_backups or where ever you like
Code:
nano /home/admin/user_backups/backup.shCOPY THE FOLLOWING CONTENT and SAVE DONT FORGET TO chmod 777 backup.sh and then run it like ./backup.sh So what this will upload all your content to AMAZON s3, but before you do this please create your bucket and folder inside your bucket for example , I have a BUCKET NAME - YOURBUCKETNAMEHERE inside that bucket I have a folder called Directadmin
#!/bin/bash
S3_BUCKET=YOURBUCKETNAMEHERE
DATE=`date +%d%m%Y_%H%M`
BACKUP_LOC=/home/admin/user_backups/
LOG=/tmp/log_$DATE
mysql_backup(){
echo "Syncing files from $BACKUP_LOC to s3 bucket" >> $LOG
s3cmd sync -r $BACKUP_LOC s3://$S3_BUCKET/Directadmin/
}
mysql_backup
exit 0Was this worth your time?


