Setting up crontab for user?

I’m having trouble setting up a crontab for my user on the HA Green unit I have.

If I’m root, I can use: crontab -u {user} -e

… but as soon as I save it it goes away!

If I try to use my {user} account … I get a message that says:

Permission denied

It shouldn’t be this hard, should it?

Yes it should. Why does /etc/passwd get reset every time I update HAOS? - #2 by tom_l

If you want to make changes at the OS level you have chosen the wrong installation method.

1 Like

Home assistant operating system is a variant of what is called an immutable operating system. Meaning that when you make changes to any file in the file system of the root partition, any reboot, it goes back to its original state. This is by design and it keeps the provisioning of the operating system robust, reliable, and easy to upgrade.

If you want your changes to persist, you will have to find the way to store them in the data partition and then do what is called a bind mount of that file on top of the existing file. You can also run Home Assistant Container Edition under a regular Linux system, or you can run the Core version under a regular Linux distribution. And then you will get the benefits of being able to change any files persistently, but you lose the benefits of having add-ons.

Just an idea: maybe, it’s not bad to share what you want to achieve by that so another solution might be given.

1 Like