openHABian lost crontab

  • Platform information:
    • Hardware: RaspberryPi 3B+
    • OS: raspbian 9 (stretch) / openHABian
    • openHAB version: 2.5.0~S1549-1 (Build #1549)

Yesterday, it has been the second time now that my openHABian lost its crontab. Last time before it was (coincidentally?) also on a Friday morning reboot.
My crontab contains some tasks like backup, but also one task to reboot at night in order to have the filesystem checked at boot.
And then it sometimes happens that after the reboot the crontab is empty. Here are the corresponding lines from the syslog:

May 10 03:20:27 HomeControlBase cron[336]: (CRON) INFO (pidfile fd = 3)
May 10 03:20:27 HomeControlBase kernel: [    0.219008] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
May 10 03:20:27 HomeControlBase kernel: [    0.220576] bcm2835-rng 3f104000.rng: hwrng registered
May 10 03:20:27 HomeControlBase systemd[1]: Starting LSB: Start/stop sysstat's sadc...
May 10 03:20:27 HomeControlBase cron[336]: /var/spool/cron: No such file or directory
May 10 03:20:27 HomeControlBase cron[336]: /var/spool/cron: created
May 10 03:20:27 HomeControlBase cron[336]: crontabs: No such file or directory
May 10 03:20:27 HomeControlBase cron[336]: crontabs: created
May 10 03:20:27 HomeControlBase cron[336]: crontabs: chowned
May 10 03:20:27 HomeControlBase systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
May 10 03:20:27 HomeControlBase systemd[1]: Started D-Bus System Message Bus.
May 10 03:20:27 HomeControlBase cron[336]: (CRON) INFO (Running @reboot jobs)
May 10 03:20:27 HomeControlBase dhcpcd[339]: dev: loaded udev

Has anyone of you had the same issue? I never had this with my other raspberryPis. Is OpenHab doing something here?

Thanks for tips!

Regards,
stedon81

openHABian is just a bunch of scripts to install and configure IH and some third party apps on to of a stock Raspbian. I can’t imagine that it would cause this as one you set everything up in doesn’t run. Similarly, openHAB had it’s own cron (cron triggered rules) and never interacts with the system ones. And even if it did, unless you are running oh as root, it wouldn’t have permission to touch these missing crontabs.

Sadly, files that inexplicably disappear is a sign of a failing SD card. You should poll a raspberry pi forum but be prepared to have to replace the SD card.