Re:How to Run CRON Jobs in Postgres Without Extra Infrastruc...
by NeutralForest on Friday May 30, 2025 @05:20PM
(#44139979)
Tangential since it's not PG related but I'm more and more moving away from cron and I prefer using systemd timers (I'm on RHEL at work). I just find the interface to list and manager timers better and I can just handle everything like a systemd service anyways.
[ Parent
| on HN ]
Re:How to Run CRON Jobs in Postgres Without Extra Infrastruc...
by jimis on Friday May 30, 2025 @07:11PM
(#44140599)
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.
Re:How to Run CRON Jobs in Postgres Without Extra Infrastruc...
by r2_pilot on Friday May 30, 2025 @07:40PM
(#44140766)
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) ```
Re:How to Run CRON Jobs in Postgres Without Extra Infrastruc...
by sherburt3 on Friday May 30, 2025 @07:32PM
(#44140722)
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”
Re:How to Run CRON Jobs in Postgres Without Extra Infrastruc...
by samtheprogram on Friday May 30, 2025 @10:37PM
(#44141491)
I would try *.timer. If you’re in zsh, quote it.
Re:How to Run CRON Jobs in Postgres Without Extra Infrastruc...
by NeutralForest on Saturday May 31, 2025 @04:18AM
(#44142813)
Like the others said, you have to list them and save it somewhere, it could be better in that regard.