Am 24.04.2014 17:20, schrieb Maciej Puzio:
I am sorry to say that the decision to replace cron.daily tasks with systemd timers is causing problems. After a routine update I noticed that my machines now perform daily maintenance tasks exactly at midnight. Not only is this time not optimal (too early), but all machines perform their maintenance at the same moment, which is far from ideal, especially for servers. Previously I had each server to perform daily cron jobs at various times, spread between 3 and 6am. On my machines this affects updatedb, man-db, logrotate and shadow, updatedb generating a lot of I/O and thus being the most problematic. I was not able to find any way to configure systemd to fire daily calendar timers at a different time of the day (please correct me if I missed something). So far I found two workarounds:
This is supposed to be handled by the AccuracySec=, which is supposed to schedule timers at random times within the specified interval (in our case, 12h). I have no idea why this doesn't work, it's definitely worth looking into.
1. Override timer files and set OnCalendar with a specific time, rather than "daily". This has to be done separately for each timer.
Yes, bad solution. As I said above, we should try to figure out why AccurarySec= doesn't do anything first.
2. Restore cron.daily scripts and mask relevant systemd services and timers (i.e. revert the configuration to what it was before the update). The resulting config is simpler to manage than the first workaround (no separate time settings for each task), so I went with this one.
This shouldn't be a permanent solution.