testsAndMisc/linux_configuration/scripts/periodic_background/digital_wellbeing/llm-notes/units-and-tasks.md
Krzysztof kuhy Rudnicki 346eb1f00b Bring every markdown file under the cap
Twelve prose violations to zero. Eight files split into per-topic
subdirectories with the original left as an index; both SKILL.md files
keep their frontmatter so discovery still works, with detail moved to
references/.

Deleted docs/cleanup-2026-05/ (7 files) and linux_configuration/docs/
VERIFICATION.md on the user's ruling: unreferenced records of finished
work whose rules are now enforced by the polling, shellcheck and shfmt
hooks. PACMAN_WRAPPER_SECURITY.md was split instead - unlike those, it
documents live guarantees.

Every split verified by a sorted diff against HEAD: zero content lines
lost, only the new headings and index links added.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-16 19:25:59 +02:00

1.6 KiB

Systemd units, check-script logic and common tasks

Systemd Units

Timer (fires every minute)

[Timer]
OnCalendar=*:*:00
Persistent=false
AccuracySec=1s

Check Service

[Service]
Type=oneshot
ExecStart=/usr/local/bin/day-specific-shutdown-check.sh

Path Watcher

[Path]
PathChanged=/etc/shutdown-schedule.conf
Unit=shutdown-schedule-guard.service

Check Script Logic

# Pseudocode for day-specific-shutdown-check.sh

source /etc/shutdown-schedule.conf
day=$(date +%u)  # 1=Monday, 7=Sunday
hour=$(date +%H)

if [[ $day -le 3 ]]; then
  shutdown_hour=$MON_WED_HOUR
else
  shutdown_hour=$THU_SUN_HOUR
fi

# Check if in shutdown window
if [[ $hour -ge $shutdown_hour ]] || [[ $hour -lt $MORNING_END_HOUR ]]; then
  systemctl poweroff
fi

Common Tasks

Check Current Status

/usr/local/bin/day-specific-shutdown-manager.sh status
# Or run setup script with 'status' argument

Make Schedule Stricter

Edit the constants in setup_midnight_shutdown.sh:

SCHEDULE_MON_WED_HOUR=20  # Changed from 21 to 20 (earlier)

Then re-run:

sudo ./setup_midnight_shutdown.sh

Make Schedule More Lenient (Requires Unlock)

sudo /usr/local/sbin/unlock-shutdown-schedule
# Wait for delay, edit config, save

Disable Timer (Will Be Re-Enabled!)

sudo systemctl disable --now day-specific-shutdown.timer
# Monitor service will re-enable it automatically

Check Protection Status

lsattr /etc/shutdown-schedule.conf
# Should show: ----i--------e--

systemctl status shutdown-schedule-guard.path
systemctl status shutdown-timer-monitor.service