[LRUG] Disrespectful cron

Jon Lim snowblink at gmail.com
Tue Feb 13 08:35:03 PST 2007


Can you run the script by hand?
Is the time of the server what you think it is?

On 13/02/07, Andrew Stewart <boss at airbladesoftware.com> wrote:
> Hi Everyone,
>
> I'm trying to set up cron on a server so that I can clear out old
> sessions, rotate log files, etc.  I've used cron lots of times before
> but for some reason can't get it working now.  Is anyone out there
> good at this sort of thing?
>
> I've simplified what I'm trying to do as far as I can but am still
> stuck.  Here it is:
>
> I have a Ruby script at /home/deploy/cron_test.rb:
>
>    #!/usr/bin/ruby
>    puts 'Hello'
>
> Its permissions are 777.  Running 'which ruby' gives /usr/bin/ruby.
>
> crontab -l gives:
>
> 35      *      *       *       *       /usr/bin/ruby /home/deploy/
> cron_test.rb > /home/deploy/cron.log
>
> (I update the minutes field every time I try to test cron.)
>
> Now I would expect cron to fire at 35min past any hour and write
> 'Hello' to the file /home/deploy/cron.log.  But nothing is written to
> that file.  In fact the file is not created at all.  Creating it
> myself and giving it 777 permissions doesn't help either.
>
> So as far as I can tell cron is not executing my crontab.  cron
> itself is running as proved by ps aux | grep cron:
>
> root     32229  0.0  0.3  2480  960 ?        Ss   08:37   0:00 crond
> deploy     950  0.0  0.1  1672  448 pts/0    R+   11:04   0:00 grep cron
>
> Does anyone have any ideas?
>
> Thanks and regards,
> Andy Stewart
> _______________________________________________
> chat mailing list
> chat at lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>



More information about the Chat mailing list