protecting data integrity of a server which is always on
As we know, with all *nix machines, it's bad for the machine to be shutdown without rebooting. However, the reason we use *nix instead of Windows is so that we don't have to constantly be rebooting.
So, is there some command I can put into a cron job that will write whatever needs to be written to the harddrive so that if the power goes out, I don't have as much of a chance of data corruption? Thanks! |
The command:
sync will flush buffers to the disk. |
excellent, I will do that!
|
So, you're going to put in a cron job to sync, what, every 5 minutes? You're still playing a roulette game with power outage, and you're messing with your machine's speed and efficiency.
Why not just get a UPS? They aren't that expensive. If you're worried about little blips in the power, that would take care of it, and would be nicer to the server in general. If you're concerned about real outages, install the software that talks to the UPS and get whatever cable is required for that UPS. Then your server will shut down properly if there is a real power outage. Any OS is subject to problems of power outage. Yank the power plug on a Windows box a few times, and it's likely to come up blue. |
sync(8)
Code:
The sync utility utilizes the sync(2) function call. Code:
a sync() system I have to second the recommendation for a UPS. FreeBSD is very good 99% of the time recovering from ugly shutdowns... but why take the chance? |
All times are GMT -5. The time now is 07:57 PM. |