0

I have a project and it is running a c program on the PI. The program is meant to start running at startup.

So far I have tried to do this with rclocal, but this is depricated. Afterwards I tried using SystemD, but I kept getting startup issues when the service tried to start. Now I would like to try crontab, but this is only documented for python.

Anybody who can help me out/got a solution?

J. Joly
  • 1
  • 2

1 Answers1

0

I don't understand what you mean when you suggest crontab is only documented for Python. You clearly have not looked at the documentation as there is no mention of Python.

man 1 crontab

man 5 crontab

The documentation should always be looked at first.

Add an entry such as the following to your crontab (crontab -e).

@reboot /home/pi/myprog

Where myprog is your program and needs to be executable (chmod +x myprog).

If myprog references files make sure you give the full path (or cd into the expected working directory in the crontab command).

joan
  • 71,852
  • 5
  • 76
  • 108