Professional Web Applications Themes

Help with cron - Ubuntu

Hello all, Tried as I might, I have been trying to schedule my downloading of podcasts for the wee hours of the morning. I am editing the crontab with the -e switch. It opens in my prefered editor, nano. Here is what is entered... #check for podcasts at 0345 daily 45 03 * * * ~/podget-0.5.7/podget.sh I restart the cron after I edit the file with sudo /etc/init.d/cron restart Then I wait and nothing. I enter the command from the command line and it works. Am I just missing something in the syntax? I have checked the web over and ...

  1. #1

    Default Help with cron

    Hello all,

    Tried as I might, I have been trying to schedule my downloading of
    podcasts for the wee hours of the morning. I am editing the
    crontab with the -e switch. It opens in my prefered editor, nano.

    Here is what is entered...

    #check for podcasts at 0345 daily
    45 03 * * * ~/podget-0.5.7/podget.sh

    I restart the cron after I edit the file with

    sudo /etc/init.d/cron restart

    Then I wait and nothing. I enter the command from the
    command line and it works. Am I just missing something in
    the syntax? I have checked the web over and over and I
    think I am doing it right. I even checked the podget
    website where they have a quick guide and it all looks
    ok.

    Your help is needed. Thanks in advance,

    Chris
    Chris Guest

  2. #2

    Default Re: Help with cron

    Chris said something like a ...
     

    Editing crontab as root? Is root allowed to execute the script? What is
    the content of the script? Post it, please.

    --
    BlackTopBum
    You don't skateboard?
    What worthwhile thing are you doing !?

    BlackTopBum Guest

  3. #3

    Default Re: Help with cron

    "Chris" <com> schreef in bericht
    news:localdomain... 
    AFAIK not needed ater ´crontab -e´
     
    What ´s your working directory at this point?
    Assuming ~ , try
    45 03 * * * cd ~/; sh ./podget-0.5.7

    Hansh


    news.vanharten.speedlinq.nl Guest

  4. #4

    Default Re: Help with cron

    On Sat, 2 Sep 2006 02:32:21 +0200
    "news.vanharten.speedlinq.nl" <invalid> wrote:
     

    Personally I'd be entering the full path the the script.

    --
    Roger Brown
    no-ip.org
    http://rogerbrown.no-ip.org

    Roger Guest

  5. #5

    Default Re: Help with cron

    "news.vanharten.speedlinq.nl" <invalid> schreef in bericht
    news:edajep$eau$qinip.net... 

    Oops, should be
    45 03 * * * cd ~/; sh ./podget-0.5.7/podget.sh

    HansH


    hansh Guest

  6. #6

    Default Re: Help with cron

    Chris wrote: 

    You may have messages on /var/log/syslog that'll indicate what went wrong.

    When you run successfully from the command line, is it as a user or
    root? If as a user, then you should run crontab -e as a user also.

    Jeff
    jeff Guest

  7. #7

    Default Re: Help with cron

    "Roger Brown" <no-ip.org> schreef in bericht
    news:rogerbrown.no-ip.org...
    On Sat, 2 Sep 2006 02:32:21 +0200
    "news.vanharten.speedlinq.nl" <invalid> wrote:
     [/ref]
     
    Agreed, *unless* the script does not set its working directory, but does
    needs one.

    This way the script can be executed unchanged at various folders and need
    not be executable.


    HansH


    hansh Guest

  8. #8

    Default Re: Help with cron

    On 2006-09-01, BlackTopBum <wall> wrote: 
    >
    > Editing crontab as root? Is root allowed to execute the script? What is
    > the content of the script? Post it, please.
    >[/ref]

    First, thanks for all the replies.

    I would really like to run this as the user. The user has
    permission to run script for it runs fine directly.

    Also I have tried it with the complete path of

    /home/cms22/podget-0.5.7/podget.sh

    and still no joy. I have read that adding the user in
    the crontab line maybe needed...for example

    45 03 * * * cms22 /home/cms22/podget-0.5.7/podget.sh

    Your thoughts?

    Chris
    Chris Guest

  9. #9

    Default Re: Help with cron

    Chris said something like a ...
     

    Wish I could help here, but all the crons I use are system related and are
    owned by root. <boo>
    --
    BlackTopBum
    You don't skateboard?
    What worthwhile thing are you doing !?

    BlackTopBum Guest

  10. #10

    Default Re: Help with cron

    Chris <com> writes:
     

    1) You dont need to restart cron.
    2) Is the executable bit set on the .sh file?
    3) Is your user a member of crontab group?

    I recently added some "home shell scripts" to cron using "crontab -e"
    and it all just worked - so double check the things about. Use cut and
    paste to verify your execute line in a shell.

    Make it run more frequently so that you can test it sooner, e.g

    */5 * * * * /usr/bin/fetchmail

    ^ every five minutes

    --
    Tax and title extra.
    Hadron Guest

  11. #11

    Default Re: Help with cron

    On 2006-09-06, Hadron Quark <com> wrote: 
    >
    > 1) You dont need to restart cron.
    > 2) Is the executable bit set on the .sh file?
    > 3) Is your user a member of crontab group?
    >[/ref]

    Ahh.. THis maybe the fix. I am going to check and see. I am
    not sure if the user is in the crotab group. I am the main/only
    user. I am the one with the sudo privies. So does that make me
    part of the crontab group automaticlly??

    Cheers,
    Chris



     
    Chris Guest

  12. #12

    Default Re: Help with cron

    Chris <com> wrote: 

    Some remarks:
    1. There schould be no need to restart cron. It should pick up your
    crontab automatically.
    2. If I was testing whether a crontab entry works, I wouldn't want
    to wait until 3:45 AM has passed befor I know if it actually does.
    I'd set the hour field to "*" and the minute field to 2 minute in
    the future (since cron checks the crontabs only once every minute)
    or to repeat every couple of minutes.
    3. I'd not use "~/" in the path to the command but "$HOME/" or the
    actual path like "/home/username/"

    Regards
    mks

    Markus Guest

  13. #13

    Default Re: Help with cron

    Chris said the following on 2006-09-02 00:53: 

    Double check that you have a newline ending in your users crontab, i.e.:

    jonsollilleman:~$ crontab -l
    # m h dom mon dow command
    */15 * * * * /home/jonsol/Doents/Text/bookmark_sort
    <newline goes here>

    I had the exact same problem on my Ubuntu LTS 6.06.1. Cron was running
    but the job simply refused to execute. Like you, I also tried to restart
    cron, but no error messages in /var/log/syslog. When I did a "crontab
    -e" and added the extra newline at the end the job started running. I
    would bet a virtual beer you have the same problem. Cron is a bit picky
    with these things.

    HTH.

    --
    Jon Solberg (remove "nospam" from email address).
    Jon Guest

  14. #14

    Default Re: Help with cron

    On Fri, 01 Sep 2006 22:53:52 +0000, Chris wrote:
     

    First of all...
    Thanks for all the help. By reading all the replies
    I was able to get my cron configured correctly, or
    at least the way I wanted it. For those who have been
    following the thread, here is what I finally have in the
    crontab

    45 03 * * * cms22 cd ~/; ./podget-0.5.7/podget.sh

    And I added a couple of empty lines and all is well.
    Thanks again for the help,
    Chris
    zerobias Guest

Similar Threads

  1. cron job
    By cljlk in forum Linux / Unix Administration
    Replies: 1
    Last Post: April 2nd, 06:50 PM
  2. rsh and cron
    By cljlk in forum Linux / Unix Administration
    Replies: 2
    Last Post: November 14th, 03:20 PM
  3. cron
    By Richard Lynch in forum PHP Development
    Replies: 0
    Last Post: August 15th, 05:14 PM
  4. CRON: bad user
    By friesje306 in forum Sun Solaris
    Replies: 0
    Last Post: July 31st, 09:52 AM
  5. Cron Job Question
    By imanahmadi in forum UNIX Programming
    Replies: 1
    Last Post: July 9th, 01:59 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139