Artificial intelligent assistant

Temporarily stop all systemd timer units I am writing a script that prepares my Linux system for benchmarking. Among other things I want to stop all systemd timer units, and revert this action afterwards. **In short, I need the equivalent of** `service crond stop/start`. All I have found so far is `systemctl list-timers` and then manually stop each one, and afterwards manually start each. Do you know of any better, more generic solutions?

To stop all currently running timers, you can simply use:


systemctl stop '*.timer'


To restart the timers later, you’ll have to remember which ones were running at the time.


timers=$(systemctl list-units --type=timer --state=active --no-legend | awk '{print $1}')
systemctl stop $timers
# ...
systemctl start $timers


(Apparently patterns for units don’t match inactive units, so `systemctl start '*.timer'` doesn’t work.)

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 0b2643b1eddd8c9d90a828144ce1de70