How to add a custom cron?

Hello I do not understand this https://blog.linuxserver.io/2019/09/14/customizing-our-containers/

Could someone explain how I could make the following run in my tvheadend container please?

* * * * * echo "Hello" >> /config/hello.txt

Would this execute as the abc user or as root? Can I decide which?

Thanks,
Chris

Hello @Chris230291

I think it depends on the name of the file you place under /etc/crontabs :

  • every cron directive placed in /etc/crontabs/root will be run as root.
  • every cron directive placed in /etc/crontabs/abc will be run as user abc.

And so on

@Chris230291 : I’ve done several tests, and the only way to get it working was to put all cron directives into a file named /etc/crontabs/root owned by root user and root group, and with chmod 600 permissions.

Hope this helps.