Modified delete_expired_at_jobs function to retain only the next 'at'-job and delete all upcoming jobs. This ensures that only the immediate 'at'-job remains scheduled.
Adjusted the wecker.sh invocation in A72_alarm_getter.sh to redirect output to /root/wecker.log for better logging. Now, when scheduling a new alarm, the script will log the wecker.sh execution details to the log file.
Changes:
- Modified line 87 in A72_alarm_getter.sh to redirect wecker.sh output to /root/wecker.log
from:
echo "/root/iobroker_scripts/schlafzimmer/wecker.sh" | at ""
to:
echo "/root/iobroker_scripts/schlafzimmer/wecker.sh > /root/wecker.log" | at ""
Author: Michael Haider
Date: 17.12.2023
- Removed unnecessary variable interpolation in the 'echo' statement.
- Changed the path for 'atq' and 'atrm' commands to use the full path.
- Updated the 'ping' command to use the full path for better compatibility.
- Added comments and improved formatting for better script understanding.
In this commit, an echo statement is added to display the execution timestamp
in the A72_alarm_getter.sh script. The timestamp is printed with the command
'echo 'Ausgeführt um: ''.
Additionally, the script now contains a function called delete_expired_at_jobs
to check and delete expired 'at' jobs. The current time is obtained using the
'date' command and stored in the variable current_time.