Cron is Different in FreeBSD and Linux

Posted by Oliver under Open Source , Personal , Technology 
 

A while ago I got into updating my FreeBSD installation automatically. Now, I wrote my blog entry but didn’t test the cron part. I found a nice page that explained getting cron running on linux. I’m pretty sure I didn’t search for linux but that’s what I found and I figured most things like this would be the same. I was wrong :)

The problem is that in linux you have to specify the user that the command will be run as like

15 * * * * root /usr/bin/command.sh

but with FreeBSD (unix) the command does not need a user specified

15 * * * * /usr/bin/command.sh

Since I had the word “root” after the time-to-run designations I guess cron thought the command to run was “root” and then when that came up as not a command it just finished. I finally decided to take the user’s name out and I got a test script to run. Success! Well, not quite. Seems my actual script needed to have the full path to the command. Well, I put that in and it worked fine. Next thing will be to put the path in the script or crontab so absolute paths of commands will not be necessary.

 

2 Responses to “Cron is Different in FreeBSD and Linux”

  1. Robin says, November 4th, 2007 at 06:07 pm

    Wow, thanks, man. That means a lot, especially coming from you!

  2. Oliver says, November 7th, 2007 at 08:57 am

    Robin is talking about these wonderful photos she got out in Scotland :)

Leave a Reply