Run python in Cron Job


is it possible to run python file (.py) in cron job?? if yes, then can you provide the syntex which i have to follow to make it run in virtualmin??

I am trying to run job by using python script… it will check some status in multiple tables and sends emails based on conditions…

need help in configuring it in Virtualmin.

or if Virtualmin have any setup already then please let me know…


hi, well python can run outside of anything…just run the cron job as usual in any linux distro, precisely said, you dont even need virtualmin to run your crons… regards how to run it, google is flooded with info.

Hi Unborn,

thanks for the info…

I am trying to use webmin feature of scheduling cron job as per below link.

I created job and executed by clicking “Run Now” button and everything worked well, but when I scheduled it to run… its not working…
in the commend field I just placed like this - > python \folder1\folder2\… (as i said when I run immediately it works great…)

what I am doing wrong here…


Hi Praveen,

I would check the user you running the cron job under… it should be domain owner (try to avoid root user unless you have to run that job under root user). also you can explicitly use /usr/bin/python in your crontb command… aka: /usr/bin/python /path/to/your/ - that should make it working… also check your shebang but, I guess it is correct.

Edit: attaching screenshot how might simple cron job schedule looks like in virtualmin… (working one)

screenshot - full size:

Thank you…

that helped…

Providing full path of python resolved issue…



  • I am glad to helped :slight_smile: