I have cronjobs like so
* * * * * /usr/bin/psql -U usename dbname -c "select usename, now(), pg_terminate_backend(pid) from pg_stat_activity where state like 'idle%' and (now() - query_start) > interval '2 hour';" &> /home/fedora/terminate_backend.log
* * * * * /usr/bin/psql -U usename dbname -c "vacuum analyze;" &> /home/fedora/vacuum.log
The second is running and producing the requested, albeit useless, log. The above does not create a log and I have reason to believe that it is not running.
I've tried adding /usr/bin/echo "DUMB" > /home/fedora/dumb.log;
in front and still nothing appears.
It looks like so
* * * * * /usr/bin/echo "DUMB" > /home/fedora/dumb.log; /usr/bin/psql -U usename dbname -c "select usename, now(), pg_terminate_backend(pid) from pg_stat_activity where state like 'idle%' and (now() - query_start) > interval '2 hour';" &> /home/fedora/terminate_backend.log
Any help is appreciated. Might it have something to do with env vars? If looked in env
and tried adding the host 127.0.0.1, Nothing. And btw, the vacuum one works, so...