From 89991d5fc95590d889edd4a8fb9bea4b3fd9bca5 Mon Sep 17 00:00:00 2001 From: Mark Eaton Date: Sat, 10 Jan 2026 17:01:20 -0500 Subject: [PATCH] add .service and .timer for profile stats script --- profile/profile-stats.service | 19 +++++++++++++++++++ profile/profile-stats.timer | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 profile/profile-stats.service create mode 100644 profile/profile-stats.timer diff --git a/profile/profile-stats.service b/profile/profile-stats.service new file mode 100644 index 0000000..304ca30 --- /dev/null +++ b/profile/profile-stats.service @@ -0,0 +1,19 @@ +# lives at ~/.config/systemd/user/profile-stats.service + +# User-level systemd service to run update_profile.py +# Configuration is via ~/.config/profile-stats.env, no in-file path edits needed. +# Create that file with one line: +# REPO_PATH=/absolute/path/to/this/repo +# Then run: +# systemctl --user daemon-reload +[Unit] +Description=Run update_profile.py (profile stats updater) + +[Service] +Type=oneshot +EnvironmentFile=%h/.config/profile-stats.env +ExecStartPre=/usr/bin/nm-online -q +ExecStart=/bin/bash -lc 'python3 ${REPO_PATH}/update_profile.py' + +[Install] +WantedBy=default.target diff --git a/profile/profile-stats.timer b/profile/profile-stats.timer new file mode 100644 index 0000000..735cd08 --- /dev/null +++ b/profile/profile-stats.timer @@ -0,0 +1,18 @@ +# lives at ~/.config/systemd/user/profile-stats.timer + +# User-level systemd timer that "catches up" missed runs if the machine was off. +[Unit] +Description=Schedule update_profile.py with catch-up if missed + +[Timer] +# Change this to your desired schedule; examples: +# OnCalendar=daily +# OnCalendar=Mon..Fri 09:00 +# See man systemd.time for syntax. +OnCalendar=daily +Timezone=America/New_York +Persistent=true +Unit=profile-stats.service + +[Install] +WantedBy=timers.target