Compare commits
3 Commits
88d383367a
...
a6b7b3891f
| Author | SHA1 | Date | |
|---|---|---|---|
| a6b7b3891f | |||
| 685bff204f | |||
| eeb5f526d1 |
@@ -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()
|
||||
Reference in New Issue
Block a user