The classic way in Unix and Linux to schedule commands is cron. The cron daemon reads the cron tables of the users. These tables can be managed with the crontab command. The format is described in section 5 (type: man 5 crontab).
So you enter in a terminal window the command:
So you enter in a terminal window the command:
crontab -eThen you enter the following lines:
Output:#min hour monthday month weekday command
15 9,12,15 * * 1-5 /usr/bin/python3 /home/username/bin/script.py >>/home/username/output.txt 2>&1
Meaning:Output:15 : the minute of the hour when the command should run
9,12,15 : the hours on which the command should run
* : the day of the month when the command should run (* = all)
* : the monthin which the command should run (* = all)
1-5 : the day of the week the command should run (mon - fri)
/usr/bin/python3 /home/username/bin/script.py >>/home/username/output.txt 2>&1 : the command.