New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Daily Backups?
Hi I have multiple sites running on multiple VPS's. For the past few months I have been taking manual mysql and /var/www backups every few days.
I was interested in making this an automated process, but I am not sure how to go about it.
I have a Dedicated server with over 1TB of disc space for holding the backups.
How would I make each VPS automatically backup and send it's self to my Dedi?
Thanks
Comments
Place this on your /etc/crontab file:
And fill in your details
Do I put that in the /etc/crontab file on the Dedi I want to use as backup? Or on the VPS?
Oh, I forgot:
I do similar to netomx except I use tar and scp instead of rsync as I like to get full complete backups. My understanding is that rsync just does the changed files.
Rsync avoid to do exact copies, it only copy the changes
I know but I like full backups for each day so I can roll back to a particular day if I need to.
191213.tar.gz 181213.tar.gz 171213.tar.gz
And so on.
This probably will get deleted (because... you know.. the "forum that shall not be named") but there's a script semi-finished here:
https://vpsboard.com/topic/1439-stale-commands-in-htop/?p=23193
The script I believe creates daily backup with the time and date of backup creation, and has it in tar compression, and also makes mysql database backups (if you need it).
I would create a script that does essentially that, tar up the files and mysqdump the db, then rsync to backup server and send you an email with log file.
VestaCP has a pretty good backup system, you can take a look at their script and edit it to suit your needs.
Webmin has a good filesystem backup module built in that I use.
Virtualmin also has it's own backup system for the virtual hosts and all their associated databases and Maildir's
Both Webmin and Virtualmin can automatically transfer their backups to another location by means of FTP, SFTP or SSH.
Mine works fine, just adjust the rsync to scp, gzip to tar and that's all
@imtiax
I wrote a script that I use to automate backups per client. You can even mention which account to exclude, and it manages daywise backups.
This is for kloxo but you can use it with small changes to work for you.
Send your email id in PM and I will share with you.
Make sure you restrict the backup user to the exact rsync command you want to run, otherwise if that key is compromised, they would be able to copy anything on the backup server that they have access to.
Use rsync as mentioned to maintain a current mirror on the backup server (including mysqldumps or mysqlhotcopies).
Then, on the backup server, use something like rdiff-backup to build redundancy. For example you can have daily 'restore points' going back two weeks, or bi-weekly points for the last 12 weeks, etc. It's all in how you use rdiff-backup. Minimal diskspace usage, lots of redundancy.
Great advice, similar to how we do in-house backups.