11 Commits

Author SHA1 Message Date
Your Name
9aa071a32d crontab add 2025-02-13 15:42:42 -05:00
Your Name
8033b7a57b automated terminal push 2025-02-13 13:39:26 -05:00
Your Name
be3461d4a5 automated terminal push 2025-02-13 13:37:53 -05:00
Your Name
92577c120f automated terminal push 2025-02-13 08:46:45 -05:00
Your Name
f9605dbce3 automated terminal push 2025-02-13 08:35:22 -05:00
Your Name
962f35d2e9 automated terminal push 2025-02-13 08:09:04 -05:00
Your Name
70be610e92 automated terminal push 2025-02-13 07:17:06 -05:00
Your Name
f2c499cebc automated terminal push 2025-02-13 07:01:47 -05:00
Your Name
4a5b66ec21 automated terminal push 2025-02-13 06:58:55 -05:00
Your Name
2686c62bda automated terminal push 2025-02-13 06:53:51 -05:00
Your Name
4272418cb0 automated terminal push 2025-02-13 06:52:00 -05:00
4 changed files with 44 additions and 24 deletions

View File

@@ -6,16 +6,10 @@ set -x
##
echo "what up????"
echo "init > consumer.bash"
####
cd /yankee-gnome-fire-consumer
pwd
ls
whoami
python3 consumer.py

View File

@@ -2,6 +2,8 @@ import stomp
import time
import SullyGnomeRobot
import RestAPIClient
import os
import signal
print("## ")
print("## starting > JMS consumer (yankee-sully-channels-monthly)")
@@ -60,9 +62,10 @@ class MyListener(stomp.ConnectionListener):
RestAPIClient.addDownloadFailure(message.body, "error from onmessage (consumer.py)")
print("## ")
print("## starting > JMS consumer (yankee-sully-channels-monthly)")
print("## starting > (timed) JMS consumer (yankee-sully-channels-monthly)")
print("## ")
conn = stomp.Connection([('67.220.70.106', 61613)])
conn.set_listener('', MyListener())
@@ -75,10 +78,24 @@ print("## ")
print("## notification > connected to JMS server (yankee-sully-channels-monthly) 3333")
print("## ")
while True:
start_time = time.time()
print("start time /",start_time)
counter=0
while time.time() - start_time < 60:
counter = counter + 1
pass
print("waiting for 60 seconds of elapsed time: ",counter)
time.sleep(1)
print("it's been 60 seconds. what up though?")
conn.disconnect()
print("disconnected from JMS. i'll holla!")

7
crontabX Normal file
View File

@@ -0,0 +1,7 @@
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
* * * * * /yankee-gnome-fire-consumer/consumer.bash >> /var/log/yankee.log
* * * * * /yankee-gnome-fire-consumer/ping.bash >> /var/log/cron.log 2>&1

View File

@@ -28,7 +28,9 @@ def buildLogFileName():
print("server_hostname / ",server_hostname)
node_id= logFileDir + "yankee-node-" + server_ip + "-" + server_hostname + ".log"
#node_id=logFileDir + "yankee-node-" + server_ip + "-" + server_hostname + ".log"
node_id= "/var/log/yankee.log"
return node_id
@@ -48,13 +50,19 @@ def buildCronExecuteTime():
print("new_hour / ",new_hour)
cron = str(new_minute) + " " + str(new_hour) + " " + "* * *"
cron = str(new_minute) + " " + str(new_hour) + " " + "* * * "
return cron
def buildCronSituation():
return buildCronExecuteTime() +" python3 /yankee-gnome-fire-consumer/consumer.py >> " + buildLogFileName() + " 2>&1"
return "* * * * * /yankee-gnome-fire-consumer/consumer.bash >> " + buildLogFileName()
##return buildCronExecuteTime() + "/yankee-gnome-fire-consumer/consumer.bash >> " + buildLogFileName()
##return buildCronExecuteTime() +"/yankee-gnome-fire-consumer/consumer.bash >> " + buildLogFileName() + " 2>&1"
##return buildCronExecuteTime() +" python3 /yankee-gnome-fire-consumer/consumer.py >> " + buildLogFileName() + " 2>&1"
####
@@ -103,16 +111,10 @@ def writeCrontabSituation():
file_path ="crontabX"
crontab_text = """
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
* * * * * python3 /yankee-gnome-fire-consumer/consumer.py >> /var/log/yankee-downloader.log 2>&1
* * * * * /tmp/ping2.bash >> /var/log/cron.log 2>&1"""
try:
# Check if the file exists and delete if it does
if os.path.exists(file_path):
os.remove(file_path)
with open(file_path, "w") as f:
@@ -134,9 +136,9 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
f.write(sep)
f.write(sep)
f.write("* * * * * /yankee-gnome-fire-consumer/consumer.bash >> /var/log/consumer.log 2>&1")
f.write(sep)
f.write(sep)
#worksf.write("* * * * * /yankee-gnome-fire-consumer/consumer.bash >> /var/log/consumer.log 2>&1")
#f.write(sep)
#f.write(sep)
print(f"Crontab written to '{file_path}' successfully.")
@@ -150,6 +152,6 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
####################
createLogDir()
#createLogDir()
writeCrontabSituation()