All Projects → xorcare → VestaCP-Sync-Backups-To-Mega

xorcare / VestaCP-Sync-Backups-To-Mega

Licence: MIT license
VestaCP: uploading backups to the MEGA cloud

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to VestaCP-Sync-Backups-To-Mega

bash-backup
Simple backup script for GNU/Linux servers
Stars: ✭ 76 (+347.06%)
Mutual labels:  backups, backup, backup-script, megatools
pgsql-backup
PostgreSQL Backup Script. Ported from AutoMySQLBackup.
Stars: ✭ 24 (+41.18%)
Mutual labels:  backup, cron, backup-script
butdr
Backup to Cloud( Google Drive, Dropbox ... ) use rclone
Stars: ✭ 49 (+188.24%)
Mutual labels:  backup, cron, backup-script
terraform-aws-backup
Terraform module to provision AWS Backup, a fully managed backup service that makes it easy to centralize and automate the back up of data across AWS services such as EBS volumes, RDS databases, DynamoDB tables, EFS file systems, and AWS Storage Gateway volumes.
Stars: ✭ 62 (+264.71%)
Mutual labels:  backups, backup
Mysqlbkup
Lightweight MySQL backup script in BASH
Stars: ✭ 129 (+658.82%)
Mutual labels:  backup, cron
snapbtrex
snapbtrex is a small utility that keeps snapshots of btrfs filesystems and optionally send them to a remote system or syncs them locally.
Stars: ✭ 29 (+70.59%)
Mutual labels:  backups, backup
WebServerCloudBackups
Automatic backups your web projects bases and files to the clouds via WebDAV.
Stars: ✭ 20 (+17.65%)
Mutual labels:  backups, backup-script
Gemini
Automated backups of PersistentVolumeClaims in Kubernetes using VolumeSnapshots
Stars: ✭ 99 (+482.35%)
Mutual labels:  backups, backup
Wal E
Continuous Archiving for Postgres
Stars: ✭ 3,313 (+19388.24%)
Mutual labels:  backups, backup
Rdiffweb
A simplified backup management software for quick access to your archives through an efficient web interface.
Stars: ✭ 76 (+347.06%)
Mutual labels:  backups, backup
Drivebackupv2
Uploads Minecraft backups to Google Drive/OneDrive or by (S)FTP
Stars: ✭ 26 (+52.94%)
Mutual labels:  backups, backup
Xenon
Create backups of your discord server
Stars: ✭ 90 (+429.41%)
Mutual labels:  backups, backup
Bash Toolkit
Este proyecto esá destinado a ayudar a los sysadmin
Stars: ✭ 13 (-23.53%)
Mutual labels:  backup, cron
Roam To Git
Automatic RoamResearch backup to Git
Stars: ✭ 489 (+2776.47%)
Mutual labels:  backup, cron
Holland
Holland Backup Manager
Stars: ✭ 132 (+676.47%)
Mutual labels:  backups, backup
Restic Systemd Automatic Backup
My restic backup solution using Backblaze B2 storage, systemd timers (or cron) and email notifications on failure.
Stars: ✭ 314 (+1747.06%)
Mutual labels:  backup, cron
s3-mongo-backup
Mongodb backups to S3
Stars: ✭ 18 (+5.88%)
Mutual labels:  backup, backup-script
kube-dump
Backup a Kubernetes cluster as a yaml manifest
Stars: ✭ 142 (+735.29%)
Mutual labels:  backup, backup-script
docker-backup-to-s3
Docker container that periodically backups files to Amazon S3 using s3cmd and cron
Stars: ✭ 124 (+629.41%)
Mutual labels:  backup, cron
Bareos
Main repository with the code for the libraries and daemons
Stars: ✭ 651 (+3729.41%)
Mutual labels:  backups, backup

VestaCP: uploading backups to the MEGA cloud

(v-sync-backups-to-mega - script for syncing backups with Mega cloud)

This script allows to automate uploading backups to the MEGA cloud, which provides 50 GiB GiB of the cloud space for free (and provides paid plans as well).

The script is a breeze to use. You can easily install it on your own server (with the help of some little ingenuity, and if you are comfortable with the command line and VestaCP control panel). Let's go ahead and dive into the world of automated cloud backups!

The MIT License (MIT) README-RU v1.1.3 – Stabile

Dependencies

(Pre-installation of the packages required for the script)

First, you need to install MegaTools.

The autoinstall script for Linux Ubuntu 14.04: install-megatools.sh (Where can you find it? Look up for the files in the git repository!).

MegaTools and the script (v-sync-backups-to-mega) can be installed on any Linux OS, but my instructions are written for Ubuntu 14.04 and have not been tested under other systems. So, if you want to try it yourself and the outcome is successful, you are welcome to contribute to this guide.

To check, if MegaTools installed successfully: run the command megareg under any user, and it the outcome is like this:

ERROR: You must specify either --register or --verify option

..then everything is ok. while if it's like this:

megareg: command not found

then MegaTools installation failed and you should look for the problem (but normally everything goes well).

Additionally

You also need to check that megatools commands work on behalf of user "root", if they don't work (true for centos) you can try to run the following commands

export PATH=$PATH:/usr/local/bin
echo 'export PATH=$PATH:/usr/local/bin' >> ~/.bash_profile
echo 'export PATH=$PATH:/usr/local/bin' >> ~/.profile
echo 'export PATH=$PATH:/usr/local/bin' >> ~/.bashrc

Installation

(Script installation and customization)

Next, place the script (v-sync-backups-to-mega) in the /usr/local/vesta/bin/ folder and make the following small changes to the script.

Find the following line in the script file:

CLOUD_BACKUPS_DIR="DEFAULT_DIR"; #Name the backup directory in the MEGA cloud

and replace DEFAULT_DIR with the folder name of your choice. The script will automatically create a folder in the cloud with the same name (if it was absent). For instance: “vps1”, but something clear is better, and the name should be without spaces). The script will use this folder upload your backups.

Then run the following commands:

chmod 770 /usr/local/vesta/bin/v-sync-backups-to-mega
chown root:root /usr/local/vesta/bin/v-sync-backups-to-mega

Next, create a file .megarc in the root home directory (/root/.megarc), containing the following information:

[Login]
Username = Your_Mega_Username
Password = Your_Mega_Password

Check the result: on behalf of root run the command megals (or you can just run the command sudo megals #Linux Ubuntu/Debian). It should print something like this:

/Contacts
/Inbox
/Root
/Trash

If the command gives back an error, then the config file .megarc was filled with the wrong data, or you ran the command not on the behalf of root.

CRON job

(CRON job — scheduled synchronization of the backups)

Now let's use Vesta control panel to create a cron job with the command:

sudo /usr/local/vesta/bin/v-sync-backups-to-mega $1 $2

$1 - The integer number of backup copies for 1 user, stored in the cloud. When this limit is exceeded, the oldest backup is deleted. The default number of copies stored is 21. If you have few users in the panel and the backup size does not exceed 500-800 MiB, this number of copies is quite reasonable. But it's highly recommended to estimate the number of backups you need for every particular case and check the cloud regularly.

$2 – The maximum number of lines in the log file. Once this value is exceeded, the log gets cleared, leaving only a message about the cleanup (by default, this value is equal to 200,000 lines ~ 50 MiB).

CRON example

VestaCP script for uploading backups to the MEGA cloud - Cron example

The image shows an example of CRON job (every day at 7:15 a.m. the backup will synchronize with the cloud, the maximum number of copies - 21, and the maximum number of lines in the log file is 200000 ~ 50 MiB).

Log file

(The log file helps to always be aware of what's going on with your backups synchronization)

The log file records to the default folder /var/log/, with it's name generated by formula: script_name.log (/var/log/script_name.log). Log file by default:

/var/log/v-sync-backups-to-mega.log

License

The software is distributed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].