Hacker News new | past | comments | ask | show | jobs | submit login

What is the systemd equivalent for `service crond stop` and later `service crond start`?

In other words, I want to disable all jobs for some time (for benchmarking) and then bring them back up.




Maybe you could make a target unit file like “jobs.target” and in your timer unit files do “WantedBy=jobs.target”. Then you could do “systemctl start/stop jobs.target”


First, list and save the currently active timers: ```bash systemctl list-timers --state=active --no-legend | awk '{print $NF}' > /tmp/active_timers.txt ```

Stop all active timers: ```bash sudo systemctl stop $(cat /tmp/active_timers.txt) ```

Later, restart the previously active timers: ```bash sudo systemctl start $(cat /tmp/active_timers.txt) ```


Like the others said, you have to list them and save it somewhere, it could be better in that regard.


I would try *.timer. If you’re in zsh, quote it.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: