pm-suspend as a cron job

General support questions
Post Reply
buggy_the_clown
Posts: 30
Joined: 2019/04/09 18:51:47

pm-suspend as a cron job

Post by buggy_the_clown » 2019/07/09 19:05:19

Hey guys,

I hope everyone is fine. Is there a reason that pm-suspend wont run as a cron job? I can run pm-suspend from the terminal but not as a cron job by using crontab -e command (53 21 * * * pm-suspend). Also, i cannot find any useful logs..

journalctl _SYSTEMD_UNIT=crond.service
-- Logs begin at Δευ 2019-07-08 22:56:30 EEST, end at Τρι 2019-07-09 22:01:47 EEST. --
Ιούλ 08 19:56:34 localhost.localdomain crond[4343]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 8% if used.)
Ιούλ 08 19:56:35 localhost.localdomain crond[4343]: (CRON) INFO (running with inotify support)
Ιούλ 09 21:32:01 192.168.1.254 crond[4343]: (root) RELOAD (/var/spool/cron/root)
Ιούλ 09 21:39:01 192.168.1.254 crond[4343]: (root) RELOAD (/var/spool/cron/root)
Ιούλ 09 21:43:01 192.168.1.254 crond[4343]: (root) RELOAD (/var/spool/cron/root)
Ιούλ 09 21:53:01 192.168.1.254 crond[4343]: (root) RELOAD (/var/spool/cron/root)

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: pm-suspend as a cron job

Post by TrevorH » 2019/07/09 19:56:41

First thing to try is the full path to the executable. Cron runs with a very limited set of environment variables and PATH in particular does not include much at all. Try using /usr/sbin/pm-suspend instead.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

buggy_the_clown
Posts: 30
Joined: 2019/04/09 18:51:47

Re: pm-suspend as a cron job

Post by buggy_the_clown » 2019/07/09 20:12:52

YEAH!

path did the trick!

Post Reply