Jun-11-2023, 10:41 AM
(Jun-11-2023, 09:28 AM)Gribouillis Wrote: You can also replace
for last_line in file: passwith
import io file.seek(0, io.SEEK_END) # go directly to the end of the file
Thank you for this, it worked! For some reason, the other one was not pulling the newest line file, and the variable was never getting updated. Over, and over, and over again, new_line was set to: "[!] This is the line that was checked for error: Jun 11 06:46:35 NUT upsmon[516]: Poll UPS [apc1500@localhost] failed - Driver not connected" even though that was not the most recent entry, and things were now working fine.