Skip to content

Commit

Permalink
Merge pull request #399 from onc-healthit/LANTERN-592-automatic_endpo…
Browse files Browse the repository at this point in the history
…int_udpate_logs

LANTERN-592: Added logging for the automatic endpoint update cron job
  • Loading branch information
vishnu-mettles authored Sep 10, 2024
2 parents f9fb586 + 6d5a5f1 commit ea93aca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/automatic_endpoint_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ EMAIL=

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
log_file="/etc/lantern/logs/automatic_endpoint_update_logs.txt"
current_datetime=$(date +"%Y-%m-%d %H:%M:%S")

chmod +rx query-endpoint-resources.sh; ./query-endpoint-resources.sh
docker exec lantern-back-end_endpoint_manager_1 /etc/lantern/populateEndpoints.sh || echo "Lantern failed to save endpoint information in database after endpoint resource list updates." | /usr/bin/mail -s "Automatic endpoint update and database population error." ${EMAIL}
docker exec lantern-back-end_endpoint_manager_1 /etc/lantern/populateEndpoints.sh || {
echo "$current_datetime - Lantern failed to save endpoint information in database after endpoint resource list updates." >> $log_file
echo "Lantern failed to save endpoint information in database after endpoint resource list updates." | /usr/bin/mail -s "Automatic endpoint update and database population error." ${EMAIL}
exit 0
}

echo "$current_datetime - Automatic Endpoint Update complete" >> $log_file

0 comments on commit ea93aca

Please sign in to comment.