So I have two systems which each have a 32TB RAID6 array (24TB usable). The slower one takes ten hours to perform a RAID check, and I really don’t want to perform it once a week, which is what is specified in /usr/lib/systemd/system/raid-check.timer:
OnCalendar=Sun --* 01:00:00
So I could edit this entry to be once a month:
OnCalendar=Sun --1…7 01:00:00
The drawback is that this file is not marked as a config file in the mdadm package, so if that package is updated, I lose my edit.
So I could edit /etc/sysconfig/raid-check, by inserting right after the ENABLED=yes line:
(($(date +%_d) > 7)) && ENABLED=no
This has the advantage that this is a configuration file, and you would expect to find configuration information about the raid-check service here. It has the drawback, however, that it affects invocations of the raid-check service that didn’t come from the timer. It also depends on an interaction with the system raid-check.timer, i.e. knowing that it runs at least once during the first seven days of the month.
So what I’ve done is to create my own version of /usr/lib/systemd/system/raid-check.timer, which I call /usr/lib/systemd/system/raid-check-mine.timer. I then replaced the symbolic link in /etc/systemd/system/timers.target.wants/raid-check.timer to point to my new file:
ln -sf /usr/lib/systemd/system/raid-check-mine.timer /etc/systemd/system/timers.target.wants/raid-check.timer
So this does what I want, but it has the disadvantage that it’s not self-documenting–it’s in an out-of-the-way place that one wouldn’t look at for configuration files. There’s also no guarantee that something won’t recreate the link to point back to the original timer file. On the other hand, this edit survived the upgrade from F36 to F37!
So what do you think? What is the best way to achieve what I want?