centos7 soft raid每周自动同步的问题

之前redhat老版本时也遇到过这样的问题

https://blog.csdn.net/jolly10/article/details/108768360

centos7解决的办法略有不同,记录一下:

centos7默认是每周日凌晨1点进行raid检查,有点太频繁了

[oracle@qht117 data]$ ls /etc/cron*
/etc/cron.deny /etc/crontab
/etc/cron.d:
0hourly raid-check sysstat
/etc/cron.daily:
logrotate man-db.cron mlocate
/etc/cron.hourly:
0anacron
/etc/cron.monthly:
/etc/cron.weekly:
[oracle@qht117 data]$ cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed

默认的设置如下:

[root@qht117 ~]# cat /etc/cron.d/raid-check
# Run system wide raid-check once a week on Sunday at 1am by default
0 1 * * Sun root /usr/sbin/raid-check

将其修改为每月的第1个星期六进行检查 :

[root@qht117 ~]# cat /etc/cron.d/raid-check
# Run system wide raid-check once a week on Sunday at 1am by default
#0 1 * * Sun root /usr/sbin/raid-check
#modifyed to once a month on Sat at 1am.
0 1 1-7 * 6 root /usr/sbin/raid-check

重启一下crond服务,让更新生效:

root@qht117 ~]# systemctl restart crond.service

完成!

记录一下:

0 1 1-7 * 6 root /usr/sbin/raid-check好像不起作用,3月7日也会执行

改成下面这个观察一下

58 0 * * Sat root if [ $(date +\%d) -le 7 ]; then /usr/sbin/raid-check; fi

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值