[CentOS] cronjob to intiiate checkdisk ?

Mon Feb 28 10:08:10 UTC 2011
Johnny Hughes <johnny at centos.org>

On 02/28/2011 03:49 AM, Roland RoLaNd wrote:
> Dear all,
> 
> I'm trying to find a way to automate checkdisk every 1 month on a weekend.
> in other words i want checkdisk to run every saturday morning.
> 
> i can of course change the default mount/count though that wont let me
> control WHEN it will happen.
> 
> so i need your expert opinion with the following if possible:
> 
> 1. reboot into single user mode
> 2. start checkdisk for all disks
> 3. once done, reboot into runlevel 3
> 
> i've did a certain script that force checkdisk at night if there's a bad
> sector using the badblocks command though that's not enough.
> 
> 
> 
> PS: i was thinking of something of this sort:
> 
> 1 4 * sat /bin/touch /forcefsck;reboot
> 1  1 * sun rm /forcefsck
> 
> Would the above work? for all disks?

I would personally not automate this ... there are times when fsck does
not complete cleanly and needs user interaction.

I only fsck important machines when I can touch them ... at least via a
remote console.  If it completes automatically, great.  If not, I am
there to try to fix it and get the filesystem running.

I'm sure others think it is OK to do this automatically, but that is my
advise.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
URL: <http://lists.centos.org/pipermail/centos/attachments/20110228/018a5d57/attachment-0005.sig>