1

I wrote a small application, which runs etherwake. From bash it works fine and wakes up another PC. But if it is launched from crontab, then nothing happens.

Has anyone encountered a similar problem and how to solve it?

Note: Maybe it matters, that the app is written with Qt/C++, etherwake runs via QProcess and OS is Raspbian on Raspberry Pi Zero.

3

I am replying to this message because I was struggling with the same issue.

The problem seems to lie in the etherwake path. Crontab runs commands by default in /bin. But etherwake is located in sbin.

/usr/sbin/etherwake

So instead of doing:

00 06 * * * etherwake -i wlan0 00:11:22:33:44:55

The proper way is:

00 06 * * * /usr/sbin/etherwake -i wlan0 00:11:22:33:44:55

This seemed to do the trick for me. Some other people struggling with the same issue have reported that wakeonlan:

sudo apt-get install wakeonlan

solves the problem as well.

| improve this answer | |
  • 2
    Hi Kevin, if you are planning on "staying in touch with stack exchange", please read on how to format your answers. It is really simple, trust me. Cheers and have fun with us. – LinuxSecurityFreak Oct 31 '19 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.