1

I have a text file stored in a server which can be accessed by a user name and password. The text file is updated each 1 hour. I want to build a python program which can read the text file in every 1 hour using the user id and password. I will later use the text file to store the data in a MySQL server where it will use the data to show in an mobile app. But I need to figure out how to read data in every hour first.

  • Can you use the Requests library (https://requests.readthedocs.io/en/latest/) to get the file and a cronjob to execute the retrieval script on an hourly basis? – myke Jul 27 '22 at 09:11

2 Answers2

1

There are several ways to achieve this. You can set up a cron job on your server. An alternative is to expose an endpoint that you call from an external cron job service. I have used https://www.setcronjob.com/ on a couple of projects. Easy to setup and fairly cheap.

Daan
  • 1,663
  • 1
  • 15
  • 13
1

If you want with python, there is also a library to do that https://pypi.org/project/python-crontab/ You need create the job in your server and implement the logic you want to do on your python script

Alvaro
  • 51
  • 3