Results 1 to 4 of 4
Discuss Nightmare running Cron job at the Linux Section within the DigitalWorldz - Satellite, Cable, Console Forums; 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 ...
  1. #1
    VIP Member
    Join Date
    Apr 2006
    Location
    Auckland, New Zealand
    Posts
    1,151
    Downloads
    0
    Uploads
    0

    Nightmare running Cron job

    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???


    Last edited by Shindig; 7th July 2012 at 21:29.

  2. #2
    The Oracle
    Join Date
    Dec 2011
    Location
    North Yorkshire
    Posts
    4,438
    Images
    5
    Downloads
    1
    Uploads
    2

    Re: Nightmare running Cron job

    As you probably know, it could be a few things but I'm favouring either user pi hasn't got the right perms within cron or, due to restricted environment, you need to put full paths to commands...

    I assume those timings are example only - you don't want to run every minute???

  3. #3
    VIP Member
    Join Date
    Apr 2006
    Location
    Auckland, New Zealand
    Posts
    1,151
    Downloads
    0
    Uploads
    0

    Re: Nightmare running Cron job

    Yes, those timings were for testing only. Nothing permanent.

    I will add the full paths in to wakeonlan

  4. #4
    VIP Member
    Join Date
    Apr 2006
    Location
    Auckland, New Zealand
    Posts
    1,151
    Downloads
    0
    Uploads
    0

    Re: Nightmare running Cron job

    So I got it sorted.
    Entered in the full path to wakeonlan but also added pi to the crontab group in /etc/group.

    Cheers for the heads up around the full path, I am sure I had added it before but hadn't worked.
    Anyway... on to remote drive spinup before synctoy kicks in.



Similar Threads

  1. script / cron job auto reboot tm500
    By TheCheekyMonkey in forum Satellite - Technomate (linux) Receivers
    Replies: 2
    Last Post: 22nd August 2010, 03:08
  2. UP AND RUNNING AGAIN..BUT
    By jacko5 in forum General Chat
    Replies: 0
    Last Post: 11th February 2002, 18:34
  3. Best aeriel for the job
    By catkin in forum AV & HOME CINEMA
    Replies: 1
    Last Post: 3rd February 2002, 20:05
  4. Is everybody running scared
    By allroad in forum AV & HOME CINEMA
    Replies: 0
    Last Post: 19th November 2001, 20:15
  5. New Jobs
    By Mick in forum General Chat
    Replies: 0
    Last Post: 6th November 2001, 07:36

Visitors found this page by searching for:

raspberry pi cron job

raspberry pi crontab not working

raspberry pi run cron

raspberry pi cron

raspberry cron job

raspberry cron problem

pi crontab

cron job in raspberry pi

crond raspberry pi

how to setup a cron job on raspberry pi

raspberry pi at cron

raspberry create cron

crontab permissions raspberry pi

raspberry add task to cron

crontab not working raspberry pi

where to put my cron scripts raspberry

raspberry pi cronjob not running

raspberry crontab logfile

automated tasks on raspberry pi

raspberry pi view cron log

raspberry pi crontab not execute

raspberry check if cron run

raspberry pi configure cron

cron log file raspberry

raspberry pi timed task

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright Digitalworldz 2013