October 2007
M T W T F S S
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  

Cron is Different in FreeBSD and Linux

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 comments to Cron is Different in FreeBSD and Linux