LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to backup entire system without shutting down (https://www.linuxquestions.org/questions/linux-general-1/how-to-backup-entire-system-without-shutting-down-187788/)

andrewjschmidt 05-30-2004 06:43 PM

How to backup entire system without shutting down
 
I have a personal Linux server (http, mysql, mail, etc) that runs 24x7. I would like to get some input on the easiest way to back the entire system up while it is running (I don't want to stop mail, web, or DB stuff when it backs up). I don't care about full vs. incremental, but I assume incremental is the most sensible since the majority of the system doesn't change a whole lot from day-to-day. I have tons of hard drive space, some of it on other network pcs, so space isn't an issue.

1) What would be the easiest way to accomplish the backup (and restore if the disk failed)?

2) If I restore the system from a rescue cd after backing up while the system was running, would it restore correctly OR does it require a shutdown?

Thanks a bunch,

Andy

trickykid 05-30-2004 09:15 PM

Why would anyone ever need to backup by shutting down their system? Tell us what media you want to backup to, another portion of your drive or a free drive, etc and we might be more of help as there are many ways to backup a system, using command line tools or other applications solely made to backup data, etc. Some even just tar the bit and pieces that are important to them by creating their own scripts, etc.

Crito 05-30-2004 09:57 PM

Quote:

Originally posted by trickykid
Why would anyone ever need to backup by shutting down their system?
So you can restore the system to a consistent state. Using the above mentioned apps, say you had a cron job that periodically checked for data delivered via email. The script might fire a database transaction involving multiple updates which, if they all succeed, are committed or, if one fails, are all rolled back. At the end of a successful commit the script might also update a web page containing summary information. In such a scenario "hot" backups probably wouldn't be a good idea. You might restore it to a state after the email was read but before any database transactions, in which case the incoming data would be lost. You might restore it to a state between updates, leaving the database in an inconsistent state. You might restore it after the commit but before the website update. So, shutting down services in the proper order -- mail, then database and finally web server -- before backing up would be the only way to ensure your ability to restore the system to a consistent state.

andrewjschmidt 05-30-2004 10:00 PM

More info...
 
Sorry, I guess I could have provided more...I am wanting to simply backup to another hard drive. I was under the impression that backing up files that are being actively used or written to would not work (maybe I'm wrong, rebooting all the time could be one of those leftover bad-habits from the Windows days).

Anywho, I considered just tarring the directories I need, but it seems like I always forget something. Given the ample space I have, and a relatively small install (~2.5G), I don't mind just copying the whole filesystem and not worrying about which ones I do or don't want to backup (better safe than sorry). However, dumping the entire system everyday would be overkill, so that pretty much excludes a simple tar operation. Some kind of daily cron job would probably fit fine for me. I've never worried about backing up, so I don't know which tools are available (much less do I know which ones are preferred).

Thanks for helping!

PGDubbin 05-30-2004 10:12 PM

For what it's worth about two years ago:

I had a cron job setup to do the following:

2:00AM - activate my CD-RW and wipe the RW disc clean (kept the disc in at all times)
2:01AM - erase old timestamp file
2:02AM - touch a new file called timestamp and echo my uptime and current date/time into the file
2:03AM - Create an iso image of my home directory
3:00AM - burn the iso image
4:00AM - erase the old iso image

It worked flawless every night for about 6 months, I effed something up on my system and said, "Hmm sit here and fix it for hours, or just reinstall and copy my backup CD...brilliance..."

Formatted - Pulled the CD out, dropped it, scratched it and kicked myself in the ass. :eek:

Crito 05-30-2004 10:23 PM

I'm quite fond of Mondo Rescue for "hot" backups.

andrewjschmidt 06-01-2004 06:01 PM

Looks good thanks
 
Mondo looks like it will accomplish exactly what I'm looking for. Thanks for the help!


All times are GMT -5. The time now is 10:27 AM.