Synchronize your files automatically to Mega with Sync2Mega.
Requirements
- Linux
- RSync
- Tar
- Megatools
- Mega account
Installation
apt-get install rsync tar megatools
Configuration
Create .megarc with your Mega credentials:
[Login]
Username = <mailuseby@mega.co.nz>
Password = <megapassword>
Edit DATA, SQL and add as needed:
# DATA
echo "-> Backup data in ${TEMPDIR}..."
mkdir $TEMPDIR/apache2
rsync $OPTS /etc/apache2/sites-available $TEMPDIR/apache2
rsync $OPTS /var/www $TEMPDIR
# END DATA
# SQL
echo "-> Dump SQL databases in ${TEMPDIR}..."
mkdir $TEMPDIR/mysql
mysqldump -u -p | gzip >$TEMPDIR/mysql/.gz
#END SQL
Create a new entry to your crontab file:
crontab -e
And paste (every day at 6h):
0 6 * * * /path/./sync2mega.sh
Source
Backup2Mega: https://github.com/hardware/Backup2Mega
Sysadmin and DBA tips: http://albertolarripa.com/2013/07/10/megatools-synchronizing-your-backups-to-mega/