LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-11-2015, 09:39 AM   #1
Tons of Fun
Member
 
Registered: Dec 2004
Location: Orlando, Florida
Distribution: Debian 10 | Kali Linux | Ubuntu 20.04 LTS
Posts: 382

Rep: Reputation: 37
Suggested backup solution for easy recovery


I set up a Debian 7 server for our intranet using a re-purposed server. After the OS, I installed Apache, MySQL, and PHP for the site. I then installed Joomla and started creating the site. About the time I was researching a backup solution for the server, the HD died and I lost everything. Not critical as the site wasn't online yet, but still irritating that I didn't install a backup solution right after I installed Joomla.

So I would like suggestions on a good backup solution that will allow me a quick restoration. I have set up backup solutions with Windows servers in the past using Symantec and Shadow Protect, but never a Linux backup.

Should I look at images, or maybe a series of full backups? I have been looking at rsync, Bacula, and Back in Time, but not sure which solution would be the easiest to restore if I need to.

Thanks in advance for any advice you can provide.
 
Old 03-11-2015, 10:03 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Some say tar is the simplest tool and also the easiest one. Rsync reliable for local or network transfer.
 
Old 03-11-2015, 10:04 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,473

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
First off, if you can do so then set up a hardware RAID, while RAID IS NOT A BACKUP it gives you a little mitigation against a single HD failure.

My personal preference is to take daily MySQL dumps of databases to a specific folder (unimaginatively I use /backup).
Then use dirvish to create remote snapshots of at least /etc, /backup and /home at regular intervals, generally daily.

For my personal sites I keep dervish vaults on separate servers, one of which is configured as a "warm" standby for my main sites and I also backup to a RasPi at home.

At work I do something similar with the resulting backups being written to a rotation of LTO-4 tapes in an autochanger (hoping to go to LTO-6 soon).

One of the joys of using dirvish is that the backups are differential so it's also easy to go back a few generations if necessary and the files are presented as a familiar folder "tree".
 
Old 03-11-2015, 10:30 AM   #4
Tons of Fun
Member
 
Registered: Dec 2004
Location: Orlando, Florida
Distribution: Debian 10 | Kali Linux | Ubuntu 20.04 LTS
Posts: 382

Original Poster
Rep: Reputation: 37
Thanks to both of you for your reply. If I use Dirvish to take snapshots, how would I restore if I needed to do a complete restore? Would I need to reinstall Debian, install Dervish, and then restore the last image?
 
Old 03-11-2015, 10:43 AM   #5
Miati
Member
 
Registered: Dec 2014
Distribution: Linux Mint 17.*
Posts: 326

Rep: Reputation: 106Reputation: 106
You could also do a "poor mans" incremental with rsync and cp's hard linking.

Code:
#!/bin/bash

dir_name="$(date '+%m_%d_%Y')"
rsync -tha --delete-after /directory/backup-from/ /Backup/backup-to/

cp -al /Backup/backup-to/ /Backup/increm_backup/"$dir_name"
The above rsync's to the destination and delete's extra files (so it stays clean)
Then, it hard links the contents to a directory named for that day.
Since hard links are just another pointer to the same info no extra space is used (except for pointer info)
If the data is corrupted or written over (shredded) you'll have issue, but otherwise works really well.
You can go back to whatever day and grab a file that's be deleted for example.
It won't rotate them though, so it'll keep piling up.

This link gives a good explanation.
http://www.mikerubel.org/computers/rsync_snapshots/
 
Old 03-11-2015, 10:44 AM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,473

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by Tons of Fun View Post
Thanks to both of you for your reply. If I use Dirvish to take snapshots, how would I restore if I needed to do a complete restore? Would I need to reinstall Debian, install Dervish, and then restore the last image?
Depends on what you back up. Personally I back up content and key configuration files rather than doing whole system backups, that way if I have to restore on to different hardware or a different distro I can do so relatively easily.


There would be nothing to stop you taking a complete system backup if you so desired though.
 
Old 03-12-2015, 07:40 AM   #7
Tons of Fun
Member
 
Registered: Dec 2004
Location: Orlando, Florida
Distribution: Debian 10 | Kali Linux | Ubuntu 20.04 LTS
Posts: 382

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by TenTenths View Post
Depends on what you back up. Personally I back up content and key configuration files rather than doing whole system backups, that way if I have to restore on to different hardware or a different distro I can do so relatively easily.
That's something for me to think about. This is a re-purposed server. If it dies, I would like to be able to restore to a new machine if I need to.

My biggest concern is to be able to restore Joomla. It uses Apache, MySQL, and PHP, all of which I can install via instructions, but don't have a working knowledge of. How would I back up Joomla to make sure that if I did need to restore it to a rebuilt machine, I could restore it and be back in service? If it was a typical program or a group of files, I would know how. But being a CMS, I'm not sure of how to approach it. I will use Akeeba Bacup within Joomla, but don't want to have to rely on it exclusively.

Thanks again for everyone's help!
 
Old 03-12-2015, 08:49 AM   #8
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,473

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by Tons of Fun View Post
My biggest concern is to be able to restore Joomla. It uses Apache, MySQL, and PHP, all of which I can install via instructions, but don't have a working knowledge of. How would I back up Joomla to make sure that if I did need to restore it to a rebuilt machine, I could restore it and be back in service? If it was a typical program or a group of files, I would know how. But being a CMS, I'm not sure of how to approach it. I will use Akeeba Bacup within Joomla, but don't want to have to rely on it exclusively.
In addition to any internal backup "plugin/add-on" I'd do a mysqldump of the relevant Joomla database on a regular basis (daily? hourly? how often does it change?) and then back that up along with the whole of the Joomla install folder and any folders used for attachments.
 
Old 03-12-2015, 08:53 AM   #9
Tons of Fun
Member
 
Registered: Dec 2004
Location: Orlando, Florida
Distribution: Debian 10 | Kali Linux | Ubuntu 20.04 LTS
Posts: 382

Original Poster
Rep: Reputation: 37
Thanks a lot for the help. It was the MySQL backup that I was concerned with. So I would do a backup on the /var/joomla folder with a separate MySQL backup. Upon restoration, I would restore var/joomla and then do a MySQL restore?
 
Old 03-12-2015, 08:58 AM   #10
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,473

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by Tons of Fun View Post
Thanks a lot for the help. It was the MySQL backup that I was concerned with. So I would do a backup on the /var/joomla folder with a separate MySQL backup. Upon restoration, I would restore var/joomla and then do a MySQL restore?
Yup.

You might find this interesting: http://centos.tips/mysql-backup/

This is the script I use on my personal web servers to backup MySQL databases and rsyncing them to a remote server.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup solution like rsnapshot that's easy on the hard disks... cabrilo Linux - Server 5 10-13-2013 07:08 PM
LXer: Create image for your hard drive the easy way with Redo Backup and Recovery LXer Syndicated Linux News 0 07-06-2010 04:40 PM
Disaster Recovery Solution kaplan71 Linux - Software 3 11-20-2009 03:39 PM
LXer: How to backup MySQL and recovery Using Zmanda Recovery Manager LXer Syndicated Linux News 0 09-10-2008 04:30 AM
Easy Ubuntu 6.06 (Dapper)Full Backup Solution... pazz33 Linux - Newbie 4 06-14-2007 07:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration