When I edit my crontab file with crontab -e my changes are gone after a reboot.

  • I execute crontab -e.
  • I change my schedule and press control + x.
  • I save the file with Y. (it saves to /tmp/randon filename) When I open crontab -e again I see my change.
  • When I do a sudo reboot and then crontab -e my change is gone.
  • 1
    Are you logged in as the same user each time? Every user has their own crontab. – Seamus Jun 13 '19 at 19:57
  • Also run crontab -l after logging in to list the user's crontab, and run sudo ls /var/spool/cron/crontabs to list all the crontabs. – scitronboy Jun 13 '19 at 20:15
  • I always log in with the user pi – Danny Jun 13 '19 at 20:42

I've seen this effect when you have a broken SD card. You update the file, the inode is updated in storage because it's cached and you can verify the update as long as you don't reboot your system. But when you shut down your system the updated inode cannot be written to the broken SD card. Next time you boot your system you get the old inode pointing to the old file. It's a very nasty issue.

| improve this answer | |
  • I replaced my SD card and it is working again – Danny Jul 22 '19 at 7:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.