commit message from python script

This commit is contained in:
2023-09-03 17:58:27 +02:00
parent 88d383367a
commit eeb5f526d1

View File

@@ -2,7 +2,7 @@
import os, shutil, sys
from crontab import CronTab
#from crontab import CronTab
def search_str(file_path, word):
with open(file_path, 'r') as file:
@@ -37,16 +37,16 @@ try:
except FileExistsError:
print("File konnte nicht kopiert werden")
cron = CronTab(user=os.environ["USER"])
basic_iter = cron.find_command(user_bin + os.sep + "pull_and_push >> " + my_logfile)
for item in basic_iter:
if str(item) == basic_command:
print("crontab job already exist", item)
is_exist=True
break
#cron = CronTab(user=os.environ["USER"])
#basic_iter = cron.find_command(user_bin + os.sep + "pull_and_push >> " + my_logfile)
#for item in basic_iter:
# if str(item) == basic_command:
# print("crontab job already exist", item)
# is_exist=True
# break
if not is_exist:
#if not is_exist:
#test
cron_job = cron.new(user_bin + os.sep + "pull_and_push >> " + my_logfile)
cron_job.every(10).hours()
cron.write()
# cron_job = cron.new(user_bin + os.sep + "pull_and_push >> " + my_logfile)
# cron_job.every(10).hours()
# cron.write()