Rusakko
Posts: 35
Joined: Fri Dec 14, 2012 6:18 pm

Crontab emptied itself over night

Fri Apr 01, 2016 5:35 am

Hi
I have Raspberry Pi 2 B running as home automation server. I use crontab to example send weather conditions to my whatsapp and measure temperature and humidity in my living room. Today there was no message and when I logged in I noticed crontab was empty. I believe this has happened to me once before. This is not a april fools joke, but an idea came to mind. Could this be something related to change of month? It might have been first of march when this happened before, not sure.

Rusakko
Posts: 35
Joined: Fri Dec 14, 2012 6:18 pm

Re: Crontab emptied itself over night

Fri Apr 01, 2016 5:43 am

It seems that 20:40 last night was the last log of temperature. that would indicate the time when crontab was cleared
Is there a log about something like this?

User avatar
DougieLawson
Posts: 36177
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Crontab emptied itself over night

Sat Apr 02, 2016 8:31 am

The most likely cause is PEBKAC.

Put your cron stuff in /etc/cron.d that needs root authority to change it so is unlikely to get corrupted by finger trouble.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Rusakko
Posts: 35
Joined: Fri Dec 14, 2012 6:18 pm

Re: Crontab emptied itself over night

Sat Apr 02, 2016 9:00 am

well that was helpfull

User avatar
DougieLawson
Posts: 36177
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Crontab emptied itself over night

Sat Apr 02, 2016 4:34 pm

Check the crontabs in /var/spool/cron/crontabs.

Since computers are entirely deterministic it's technically impossible for a crontab to "just disappear". There has to be an external action (usually by an operator with a keyboard and a login session) to make something like that happen. Hence PEBKAC.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Rusakko
Posts: 35
Joined: Fri Dec 14, 2012 6:18 pm

Re: Crontab emptied itself over night

Sun Apr 03, 2016 12:23 pm

Check the crontabs in /var/spool/cron/crontabs appears to be empty

Return to “Troubleshooting”