Results 1 to 9 of 9

Thread: Problem with Kcron

  1. #1
    Join Date
    May 2008
    Beans
    36

    Problem with Kcron

    I have only just started using Ubuntu in the last couple of months.

    I wanted to record some radio shows and used these instructions

    http://www.instructables.com/id/Sche...ngs-in-Ubuntu/

    Here is my script

    Code:
    #!/bin/sh
    NOW=$(date +"%b-%d-%y")
    mplayer "mms://66.70.119.243/B105" -ao pcm:file=/media/Music/Internet_Radio/Temp_Files/mystream.wav -vc dummy -vo null
    lame -m s /media/Music/Internet_Radio/Temp_Files/mystream.wav -o "/media/Music/Internet_Radio/HamishAndy/Hamish_Andy-$NOW.mp3"
    rm /media/Music/Internet_Radio/Temp_Files/mystream.wav
    As per the instructions i have a second file with

    Code:
    pkill mpplayer
    The idea being that the first script is initiated to start the recording, then the second script is called to stop it. Then it turns it into a mp3 file.

    If I enter this all in terminal it works great.

    I then set up Kcron and it also all works if I choose the "Run Now" function of Kcron.

    Problem is that it does not run as scheduled.

    Could anyone please help.

  2. #2
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Beans
    1,393
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Problem with Kcron

    Does Kcron keep a log of any errors that may have occurred when the job tried to run?

    You can also add this to the end of your mplayer command

    Code:
    > /home/username/cron.txt

    That way, if there is a specific error, you should see it in the file.

  3. #3
    Join Date
    May 2008
    Beans
    36

    Re: Problem with Kcron

    ok Thanks for your reply.

    Adding that for some reason makes the mplayer part work.

    Now however when lame starts it simply puts a 8kb file into the directory.

    Of course it works fine in terminal.

    i added your txt suggestion to the lame line and the resulting txt file is empty.

  4. #4
    Join Date
    May 2008
    Beans
    36

    Re: Problem with Kcron

    I have been looking at this all day. The recording with mplayer is ok but this line

    Code:
    lame -m s /media/Music/Internet_Radio/Temp_Files/mystream.wav -o "/media/Music/Internet_Radio/HamishAndy/Hamish_Andy-$NOW.mp3"
    So the same old story applies it runs in terminal. It even runs when you "test" it in Kcron but as soon as you schedule it you get a 40kb (5sec) mp3 file.

    I have tested this on 3 computers now and they all do the same.

    Can anyone please give me help or indicate what i could look at.

  5. #5
    Join Date
    Jul 2008
    Beans
    29
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Problem with Kcron

    Interesting

    I have been testing this too and my experience is the same.
    As I am total newby I can only wait and see if anybody can come up with solution to this
    Regards

  6. #6
    Join Date
    May 2008
    Beans
    36

    Re: Problem with Kcron

    please remember that I am also a beginner.

    By chance my now works.

    here is my specific code that works, I am sorry I do not want to make it generic in case I write something false.
    Code:
    #!/bin/sh
    NOW=$(date +"%b-%d-%y")
    mplayer "mms://66.70.119.243/B105" -ao pcm:file=/media/General/Radio/Hamish_Andy/mystream_$NOW.wav -vc dummy -vo null > /media/General/Radio/Hamish_Andy/error.log
    lame -m s /media/General/Radio/Hamish_Andy/mystream_$NOW.wav -o "/media/General/Radio/Hamish_Andy/Hamish and Andy - $NOW.mp3" >/media/General/Radio/Hamish_Andy/scripterror.log 2>&1
    #mplayer "http://resources.b105.com.au/listenfeed/b105.asx" -ao pcm:file=/media/General/Radio/mystream_NOW.wav -vc dummy -vo null > /media/General/Radio/kcron_$NOW.txt
    I am pretty sure that the two error logs are what made it work for me. They just overwrite each day.

  7. #7
    Join Date
    Jan 2008
    Beans
    1

    Re: Problem with Kcron

    This Kcron thing is wierd. Has it worked for anyone?. I have tried to use Kcron on different versions of Kubuntu, Fedora core, etc . It doesn't seem to work in any case. Is this app actually suppossed to do something.

  8. #8
    Join Date
    May 2008
    Beans
    36

    Re: Problem with Kcron

    I got it to work on something small very easily. I am a total beginner and just wrote some small script and then tested it.

    Oh I also started with the GUI. Once it produced the file I then edited the file myself for little tweaks.

    As you question is so general and because I am a beginner I am sorry but I do not think I can help further.

  9. #9
    Join Date
    Aug 2008
    Beans
    2

    Re: Problem with Kcron

    I have the same problem with my Ubuntu HH. KCron seem to do absolutely nothing. No matter what applications or scripts I schedule, it does simply nothing. Cron deamon is running, anacron as well. ;(

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
  •