Technology and troubleshooting.

Saturday, April 30, 2016

Restart fstab using cron

In this tutorial I am going to show you how to Restart fstab using crontab .

Restart fstab using crontab

My Scenario:-  I am running MYSQL database server in Linux recent days MYSQL backup scheduler is not running properly. I analyzed the log and i found there is problem with volume mount point. Remote volume often went offline.

Solution:-  I tried to list the volume using the below command.
[]#mount -l 

My remote volume not listed in the list. I had a solution for that mount -a every time open the terminal by typing the command mount -a to mount. Volume is really waste of time. So i decided to automate the task using crontab.

Note:- This is work around. I will fix this issue during non production window.

This is the command to mount all stuff from /etc/fstab.
[]#mount -a 

Here is scheduler to restart the mount point volume.

Step#1:- Open the crontab to fstab scheduler
[root@Techproxy ~]# crontab -e
Step#2:- fstab mount script
28 12 * * * /bin/mount -a
#Scheduler will run at every day 12:28 PM IST
After adding the line press ESC and type :wq! to save :q! to abort changes.

I hope this information is useful for you. Please forgive any typos or incomplete sentences.



Post a Comment

Popular Posts