Shindig
DW Regular
I have my Raspberry setup as a SSH terminal, works a treat. I can log in as pi (user) and run wakeonlan to start my windows server etc.
I have a couple of scheduled tasks setup on my server to take a backup of movies,music,photos.
Thinking, rather than leave server on I will get raspberry pi and schedule a wakeonlan command.
Looking at cron I thought easy.
So if I wanted to wakeup my server I log in as pi all as normal I can run wakeonlan -f machine from command. Sorted
setup cron I was under the impression of typing
crontab -e
add a line with the necessary timing * * * * * wakeonlan -f machine OR wakeonlan MACADD
but the thing doesnt work.
If I add a test line in
* * * * * echo "Cron Worked $(date)" >> /tmp/cronworked.txt it works and I see the txt file. Remove the txt file, it comes back! Ace CRON is running.
Really unsure why, trying to run wakeonlan as the user pi from cron fails, when I can manually type it in (as pi) as it works.
from syslog
Jul 8 08:22:01 raspberrypi cron[989]: Error: bad username; while reading /etc/crontab
Jul 8 08:22:01 raspberrypi /usr/sbin/cron[989]: (*system*) ERROR (Syntax error, this crontab file will be igno$
Jul 8 08:22:01 raspberrypi /usr/sbin/cron[989]: (pi) RELOAD (crontabs/pi)
Jul 8 08:22:01 raspberrypi /USR/SBIN/CRON[1174]: (pi) CMD (wakeonlan -f machine >/dev/null)
guys any ideas???
I have a couple of scheduled tasks setup on my server to take a backup of movies,music,photos.
Thinking, rather than leave server on I will get raspberry pi and schedule a wakeonlan command.
Looking at cron I thought easy.
So if I wanted to wakeup my server I log in as pi all as normal I can run wakeonlan -f machine from command. Sorted
setup cron I was under the impression of typing
crontab -e
add a line with the necessary timing * * * * * wakeonlan -f machine OR wakeonlan MACADD
but the thing doesnt work.
If I add a test line in
* * * * * echo "Cron Worked $(date)" >> /tmp/cronworked.txt it works and I see the txt file. Remove the txt file, it comes back! Ace CRON is running.
Really unsure why, trying to run wakeonlan as the user pi from cron fails, when I can manually type it in (as pi) as it works.
from syslog
Jul 8 08:22:01 raspberrypi cron[989]: Error: bad username; while reading /etc/crontab
Jul 8 08:22:01 raspberrypi /usr/sbin/cron[989]: (*system*) ERROR (Syntax error, this crontab file will be igno$
Jul 8 08:22:01 raspberrypi /usr/sbin/cron[989]: (pi) RELOAD (crontabs/pi)
Jul 8 08:22:01 raspberrypi /USR/SBIN/CRON[1174]: (pi) CMD (wakeonlan -f machine >/dev/null)
guys any ideas???
Last edited: