I have a python script called git_update.py to git pull a repository and I want to schedule this to run everyday at 6 AM. but the below code doesnnot work
git_update.py
import os
import schedule
import logging
import subprocess
def git_update():
out = subprocess.check_output(["git", "pull"])
if __name__ == '__main__':
schedule.every().day.at("06:00").do(git_update)
And I reason I think it doesn't work because it always asks for my password whenever I pull a repository. Is there any way I can have the password saved when I first launch the script using nohup git_update.py &
crondaemon has no access to yoursshsecrets, if indeed the SSH agent is even running when the job starts.git pull. Regarding management of secrets, see stackoverflow.com/questions/2205282/… but I'm obviously guessing what you are actually hoping to accomplish here.