Skip to content

Instantly share code, notes, and snippets.

@Exagone313
Created March 12, 2025 08:45
Show Gist options
  • Select an option

  • Save Exagone313/73f98a5185ff185616dfa383d0046f68 to your computer and use it in GitHub Desktop.

Select an option

Save Exagone313/73f98a5185ff185616dfa383d0046f68 to your computer and use it in GitHub Desktop.
List systemd timers for all users

List systemd timers for all users

How to use:

sudo machinectl shell --uid=root
sh ./list-all-timers.sh
#!/bin/sh
echo 'Timers for system'
echo
systemctl --no-pager list-timers
for ulinger in /var/lib/systemd/linger/*; do
if [ -f "${ulinger}" ]; then
echo
uname="${ulinger##*/}"
echo "Timers for ${uname}"
echo
systemctl --no-pager --machine="${uname}"@.host --user list-timers
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment