fix: improve dockcheck cron job logging and reliability
- Added comprehensive logging to /var/log/dockcheck/dockcheck.log - Created wrapper script to avoid cron variable escaping issues - Added timestamp logging for each execution with exit codes - Created proper log directory with correct permissions - Removed unnecessary -n flag (config file handles DontUpdate=true) - Added cron handlers for service management 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -135,6 +135,7 @@ Common domains requiring hairpinning fixes:
|
|||||||
- karakeep (formerly called hoarder) is deployed with both 'hoarder' and 'karakeep' tags for backward compatibility
|
- karakeep (formerly called hoarder) is deployed with both 'hoarder' and 'karakeep' tags for backward compatibility
|
||||||
- whenever i ask you what containers need updates, run dockcheck and return a list of containers needing updates
|
- whenever i ask you what containers need updates, run dockcheck and return a list of containers needing updates
|
||||||
- when i ask for the status container updates i want you to run dockcheck on the docker host https://github.com/mag37/dockcheck?ref=selfh.st
|
- when i ask for the status container updates i want you to run dockcheck on the docker host https://github.com/mag37/dockcheck?ref=selfh.st
|
||||||
|
- this is your reference for glance configuration https://github.com/glanceapp/glance/blob/main/docs/configuration.md#configuring-glance
|
||||||
|
|
||||||
## Variable Management Implementation Notes
|
## Variable Management Implementation Notes
|
||||||
**Major Infrastructure Update**: Variable management system was implemented to replace all hardcoded values with centralized variables.
|
**Major Infrastructure Update**: Variable management system was implemented to replace all hardcoded values with centralized variables.
|
||||||
|
6
roles/cron/handlers/main.yml
Normal file
6
roles/cron/handlers/main.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
# Handler to restart systemd-journald service
|
||||||
|
- name: restart rsyslog
|
||||||
|
systemd:
|
||||||
|
name: systemd-journald
|
||||||
|
state: restarted
|
@ -1,4 +1,7 @@
|
|||||||
---
|
---
|
||||||
|
# Enable cron logging in systemd-journald (already enabled by default)
|
||||||
|
# We'll rely on journalctl for cron execution logs
|
||||||
|
|
||||||
# Ensure the script is copied to the target machine
|
# Ensure the script is copied to the target machine
|
||||||
- name: Copy the warhammer feed update script
|
- name: Copy the warhammer feed update script
|
||||||
copy:
|
copy:
|
||||||
@ -80,11 +83,33 @@
|
|||||||
owner: phil
|
owner: phil
|
||||||
group: phil
|
group: phil
|
||||||
|
|
||||||
# Create cron job for dockcheck as phil user
|
# Create log directory for dockcheck
|
||||||
|
- name: Create dockcheck log directory
|
||||||
|
file:
|
||||||
|
path: /var/log/dockcheck
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
owner: phil
|
||||||
|
group: phil
|
||||||
|
|
||||||
|
# Create dockcheck wrapper script to avoid cron escaping issues
|
||||||
|
- name: Create dockcheck wrapper script
|
||||||
|
copy:
|
||||||
|
dest: /home/phil/.local/bin/run_dockcheck.sh
|
||||||
|
mode: '0755'
|
||||||
|
owner: phil
|
||||||
|
group: phil
|
||||||
|
content: |
|
||||||
|
#!/bin/bash
|
||||||
|
cd /home/phil
|
||||||
|
/home/phil/.local/bin/dockcheck.sh >> /var/log/dockcheck/dockcheck.log 2>&1
|
||||||
|
echo "$(date "+%Y-%m-%d %H:%M:%S") - Dockcheck completed with exit code $?" >> /var/log/dockcheck/dockcheck.log
|
||||||
|
|
||||||
|
# Create cron job for dockcheck as phil user with logging
|
||||||
- name: Create cron job for dockcheck container updates
|
- name: Create cron job for dockcheck container updates
|
||||||
cron:
|
cron:
|
||||||
name: "Check Docker container updates"
|
name: "Check Docker container updates"
|
||||||
minute: "0"
|
minute: "0"
|
||||||
hour: "8"
|
hour: "8"
|
||||||
user: phil
|
user: phil
|
||||||
job: "/home/phil/.local/bin/dockcheck.sh"
|
job: "/home/phil/.local/bin/run_dockcheck.sh"
|
||||||
|
Reference in New Issue
Block a user