I have a cron:
* * * * * /usr/local/bin/script 2>/tmp/cron.log
And the script
:
#!/bin/bash
if <some validation>; then
systemctl suspend
fi
So I get the error when cron executed:
Call to Suspend failed: Interactive authentication required.
Someone have a tip for this? How can I do this works?
crontab -e
from a normal user withoutsudo
. – rhuanpk Nov 27 '23 at 17:52systemctl suspend
in a normal terminal emulator? And if I don't use sudo in my system? – rhuanpk Nov 27 '23 at 18:00