J'ai ajouté la ligne suivante dans Contabcomment exécuter un programme python dans linux crontab?
1 * * * * /usr/bin/python /home/prkumar/Desktop/python/sample.py
mon sample.py fichier
text_file = open("sample.log", "a")
text_file.write("Hi...")
text_file.write("\n")
text_file.close()
Si je lance le programme python dans le terminal, il fonctionne très bien et également ajouter le texte dans l'échantillon. fichier journal. Mais il n'y a pas de réponse si vous ajoutez le programme dans crontab.
Merci
peut-être avec shebang python comme première ligne? https://en.wikipedia.org/wiki/Shebang_(Unix)#Exemples – mkind