[Answered ]-Deploying a Python Script on a Server (CentOS): Where to start?

1đź‘Ť

âś…

You should look into cron for this, which will allow you to schedule the execution of your Python script.

If you aren’t sure how to make your Python script executable, add a shebang to the top of the script, and then add execute permissions to the script using chmod.

👤Andrew Clark

1đź‘Ť

  1. Copy script to server

  2. test script manually on server

  3. set cron, “crontab -e” to a value that will test it soon

  4. once you’ve debugged issues set cron to the appropriate time.

👤monkut

0đź‘Ť

Sounds like a job for Cron?

Cron is a scheduler that provides a way to run certain scripts (apps, etc.) at certain times.

Here is a short tutorial that explains how to set up cron.
See this for more general cron information.

Edit:

Also, since you are using CentOS: if you end up having issues with your script later on… it could partly be caused by SELinux. There are ways to disable SELinux on your server (if you have enough access permissions.) But… there are arguments against disabling SELinux, as well.

👤summea

Leave a comment