backup mediawiki to amazon s3

From WebHostingNeeds.com
Jump to: navigation, search

This is for webhostingneds.com, you need to modify paths as per your mediawiki installation.

[email protected]:/home/webhostingneeds.com# cat  /home/webhostingneeds.com/backup-s3.sh
#!/bin/bash

# Author: HostOnNet.com <[email protected]>
# Cronjob = @weekly /home/webhostingneeds.com/backup-s3.sh
# AWS Setup = https://www.webhostingneeds.com/aws_configure

cd /home/webhostingneeds.com

tar cf /home/webhostingneeds.com/backup.tar public_html

mysqldump webhostingneeds > webhostingneeds.sql

# Append MySQL dump to backup.tar
tar rf /home/webhostingneeds.com/backup.tar webhostingneeds.sql

DATE_NOW=$(date +"%Y%m%d%H%M")

cd /home/webhostingneeds.com
gzip -c backup.tar > webhostingneeds-com-$DATE_NOW.tar.gz

rm -f backup.tar

aws s3 cp webhostingneeds-com-$DATE_NOW.tar.gz s3://backup-whn/

[email protected]:/home/webhostingneeds.com# 


awscli need to be configured as per aws configure



mediawiki

aws