Run Python Script after 5mins from bootup

May 8, 2024, 15:18

winikolo

i want to run a python script home/winikolo/SnCBot/main.py around 5 minutes after bootup, how do i do this?

thunder07337

Crontab

oops.se

Crontab doesn't have that feature. IMHO the easiest way is to start a script at bootup (via crontab or systemd) that has a timer that after 5 minutes execute your main.py

winikolo

oh wow thats so simple, why didnt that hit me before

winikolo

thanks mr.oops

thunder07337

There are indeed commands after a reboot!
@reboot sleep 60 && my_script.sh

oops.se

Ahhh your using the bash sleep command, nice. But increase 60 to 300 so is it closer to 5 minutes