I have used the crontab to run a command that repeats every 30 minutes. From the tutorials, I written the following command to /etc/crontab
*/30 * * * * root /usr/bin/python /home/pi/do.py>>/home/pi/output
As per the tutorials found on google, it should run for 0,30,60...minutes. But it won't run at reboot. However, it runs for every 30 minutes after reboot.
If I use the command @reboot /usr/bin/python /home/pi/do.py>>/home/pi/output
, then it will run at reboot. But actually, I need to run the command at boot and also for every 30 minutes.
How can I configure the same for a run at reboot also?
@reboot /usr/bin/python /home/pi/do.py>>/home/pi/output
without any problem. Don't make it as same question. – mcv May 06 '19 at 10:53cronjob
with asystemd timer
that is able to do both: run at boot time and every N minutes. – PerlDuck May 06 '19 at 10:58