Auto Backup DataBase to DropBox Account
Hello,
Today i will share a script which i had been using since very long on many of my clients server and it always worked great with not a single issue once configured properly.
This script will auto generate Database backup and files backup aswell and zip them and send to your remote dropbox account and will delete the local generated backup only after successful upload is done :cool:
First you need a Fresh Dropbox account (Its free and efficient, amazon S3 charges pennies but dropbox will be free forever )
[LIST]
The script dumps all of your MySQL databases as separate files.
The script backs up all of your Web files (e.g: root of all of your virtual hosts).
The script compresses your web-root and databases to a single archive.
The script uploads the compressed archive into a folder in Dropbox.
After the upload, the script cleans the temporary files (dumps, the archive itself).
The script makes sure that you always have the newest Dropbox-uploader script.
You may easily add this script to your crontab, and just forget about it - Removed -
Step 1 register this free space Dropbox Fresh WebAdmin account: [Click to register] --> - Removed -
Step 2 In your SSH console run this
- Removed -
Now login your cpanel and edit the download shell script "backmeup.sh" and make the following changes into it an save close :rolleyes:
[PHP]TIMEZONE="Europe/Istanbul" #Your timezone, for a better timestamp in archived filenames
DBUSER="root" #MySQL user that can dump all databases
DBPASSWORD="" #MySQL password
FILESROOT="/var/www" #root of your (virtual) hosting files, E.g: For apache, it is /var/www, for nginx, it's /usr/share/nginx/html "WITHOUT TRAILING SLASH"
BASEFOLDER="/tmp" #Temporary folder to create database dump folder
DROPBOXFOLDER="backmeup" #your backup folder that'll be created on Dropbox[/PHP]
Step 3 Come back to your SSH console and make the "backmeup.sh" script executable using this command
Step 4 Execute this i.e run the script
You can add it to cron, youw wish :rolleyes:
chmod 700 backmeup.sh
Step 4 Execute this i.e run the script
./backmeup.sh
You can add it to cron, youw wish :rolleyes:
Please sign in to leave a comment.
Comments
0 comments