commit message from python script

This commit is contained in:
2023-04-14 16:38:11 +02:00
parent 5e105988a9
commit 156253f578

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env python3
import os, shutil, crontab, sys
import os, shutil, sys
from crontab import CronTab
def search_str(file_path, word):
with open(file_path, 'r') as file:
@@ -27,7 +29,11 @@ else:
try:
copy_file = shutil.copyfile(os.path.dirname(os.path.realpath(sys.argv[0])) + os.sep + "pull_and_push.py", user_bin + os.sep + "pull_and_push")
os.chmod(user_bin + os.sep + "pull_and_push",0o775)
except FileExistsError:
print("File konnte nicht kopiert werden")
cron = CronTab(user=os.environ["USER"])
cron_job = cron.new(command='pull_and_push >> /var/log/pull_and_push.log')
cron_job.hours.every(17)
cron.write()