1

So I have this python code using the schedule python library. So that it can run other codes automatically on a daily basis at certain times. My school has these afs servers that us students can use and I was wondering if it was possible for me to run this code on the server than over having my labtop run 24/7.

import schedule
import time
import MTtest
import DataScrape
import MTSMScrape

schedule.every().day.at("11:00").do(MTtest.main)
schedule.every().day.at("11:00").do(DataScrape.main)
schedule.every().day.at("11:00").do(MTSMScrape.main)

while True:
     schedule.run_pending()
     time.sleep(1)

This is my code. I know it works. I am just asking if I can put it in the server and it will run no problem because I do not want my labtop on all the time. I would test it on my own but right now, I am having log in problems to the server and not sure how long it will take to fix it. So I would rather know now if this is possible. I imagine it should but maybe I am wrong. This is for a project I am working on. Thank you and appreciate the help.

HanKuSung
  • 47
  • 6
  • 2
    This depends on the server configuration. Ask an administrator. – Michael Butscher Nov 19 '18 at 23:50
  • 2
    It would probably be better to schedule a cron job for this – Henry Woody Nov 19 '18 at 23:55
  • If the servers are linux servers crontab would work. If MacOSX launch would work. If you ran a tornado server instance on a server you could start the sequence by making curl request from any other device ... again using crontab or launchd. – Keith John Hutchison Nov 19 '18 at 23:57
  • yea im pretty sure the servers r linux. I'll check out cron when I can then if this doesn't work. Uh just quick question is cron tab different from cron job or they the same just named differently? – HanKuSung Nov 20 '18 at 03:31

0 Answers0