1

my file format looks like this report_10_04_2019_18_10_38. I want to check every time if there is a new file and if exist a new file sends to my private repo. I want to keep looking for new files and every 15 minutes or 1 hour send the files back to my repo, but how can I do it?

import datetime
from github import Github

repository = "xxxxxxxxx/xxxxxxxxx"

commit_message = "hello"

crashes = "xxxx/xxxx.html"

g = Github("xxxxxxxxxxxx")


repo = g.get_repo(repository)

while True:
    repo.create_file(crashes, commit_message, "test")

jahjh21a
  • 89
  • 11

1 Answers1

0

If you're on macOS, I know a way to do this but I'm not quite sure on windows. If you are on macOS, you need to learn a bit about a new language. This is because your python script will not automatically launch itself when you turn on your computer.

If I try to explain everything here, it will take too long but if you want to know how to do this, search up launchd on macOS and you will find a lot of sources. launchd is the first program that macOS launches when the computer boots up and the last program it closes when the computer shuts down, hence, making this an excellent choice.

After this, also search up how to create a .plist file to launch python programs in launchd. This is the file type that launchd uses, just like how python uses .py and so forth.

I hope this helps!

hifromdev
  • 262
  • 3
  • 10