Open main menu

How to add crontab job

Revision as of 09:41, 31 May 2023 by Harry (talk | contribs) (→‎Add crontab job)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Add crontab job

sudo crontab -e

 

Choose "1" then press Enter

Add the command line you want to execute at the end of the file that reads like this:

@reboot python3 /home/pi/x-c1/fan.py

PS:

1. @reboot python /home/pi/x-c1/fan.py is a sample command, You MUST to modify it according to your needs.

2. Please make sure that the file path and file name are correct


 


Save and exit (CTRK + O and ENTER to save it). In nano editor, you do that by hitting CTRL + X, answering Y and hitting Enter when prompted.

Please run 'sudo reboot' to reboot device to enable crontab job.

Remove crontab job

sudo crontab -e

Then remove the command line by yourself.


Add your comment
Geekworm Wiki welcomes all comments. If you do not want to be anonymous, register or log in. It is free.