Find the answer to your Linux question:
Results 1 to 2 of 2
I am trying to program a simple cuckoo clock for openSuSe based on cron. So far I have used the instructions in the "Cuckoo Clock for Linux Project" page, using ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2012
    Posts
    2

    Cron job behaves differntly for root and non-root user.


    I am trying to program a simple cuckoo clock for openSuSe based on cron. So far I have used the instructions in the "Cuckoo Clock for Linux Project" page, using cron and crontab, and tried to test it for root with the following crontab file :
    Code:
    # DO NOT EDIT THIS FILE - edit the master and reinstall.
    # (/tmp/crontab.Y4uUE9 installed on Tue Mar 27 09:30:29 2012)
    # (Cronie version 4.2)
    1-59 * * * * bash /home/pascal/.cuckoo/cuckoo2.sh
    where cuckoo2.sh contains
    Code:
    play /home/pascal/.cuckoo/cuckoo2.wav
    This works fine (cuckoos once every minute) for as long as I (user pascal) am not logged in, and quits after I login. Then I tried to use the same file for user pascal, i.e. (I create, using crontab again, a file pascal with the same content).
    After I login it cuckoos once and then stops. What am I doing wrong? Any help will be greatly appreciated.

    - pascal
    Last edited by pligdas; 03-27-2012 at 04:59 PM.

  2. #2
    Just Joined!
    Join Date
    Feb 2012
    Posts
    2
    The problem lies not with cron, as I tested it wirh the file :
    Code:
    # DO NOT EDIT THIS FILE - edit the master and reinstall.
    # (/tmp/crontab.dtAVEN installed on Tue Mar 27 16:11:19 2012)
    # (Cronie version 4.2)
    0-59 * * * * /home/pascal/.cuckoo/testcron.sh
    where testcron.sh is :
    Code:
    date >> /home/pascal/.cuckoo/testcron
    The file testcron grows every minute :
    Code:
    pascal@linux-7vld:~/.cuckoo> cat testcron
    Tue Mar 27 16:50:01 EEST 2012
    Tue Mar 27 16:51:01 EEST 2012
    Tue Mar 27 16:52:01 EEST 2012
    Therefore, for some reason the command
    Code:
    play /home/pascal/.cuckoo/cuckoo2.wav
    stops after the first iteration. Any ideas?

    - pascal
    Last edited by pligdas; 03-28-2012 at 08:17 AM.

Posting Permissions

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