{"id":160,"date":"2007-10-28T22:42:41","date_gmt":"2007-10-29T05:42:41","guid":{"rendered":"http:\/\/blog.oliverhansen.com\/index.php\/2007\/10\/28\/cron-is-different-in-freebsd-and-linux\/"},"modified":"2007-10-29T09:20:19","modified_gmt":"2007-10-29T16:20:19","slug":"cron-is-different-in-freebsd-and-linux","status":"publish","type":"post","link":"https:\/\/blog.oliverhansen.com\/index.php\/2007\/10\/28\/cron-is-different-in-freebsd-and-linux\/","title":{"rendered":"Cron is Different in FreeBSD and Linux"},"content":{"rendered":"

A while ago I got into updating my FreeBSD installation automatically<\/a>. 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 \ud83d\ude42<\/p>\n

The problem is that in linux you have to specify the user that the command will be run as like
\n
\n15 * * * * root \/usr\/bin\/command.sh
\n<\/code><\/p>\n

but with FreeBSD (unix) the command does not need a user specified
\n
\n15 * * * * \/usr\/bin\/command.sh
\n<\/code><\/p>\n

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!<\/strong> 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.<\/p>","protected":false},"excerpt":{"rendered":"

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 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,5,10],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.oliverhansen.com\/index.php\/wp-json\/wp\/v2\/posts\/160"}],"collection":[{"href":"https:\/\/blog.oliverhansen.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.oliverhansen.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.oliverhansen.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.oliverhansen.com\/index.php\/wp-json\/wp\/v2\/comments?post=160"}],"version-history":[{"count":0,"href":"https:\/\/blog.oliverhansen.com\/index.php\/wp-json\/wp\/v2\/posts\/160\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.oliverhansen.com\/index.php\/wp-json\/wp\/v2\/media?parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.oliverhansen.com\/index.php\/wp-json\/wp\/v2\/categories?post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.oliverhansen.com\/index.php\/wp-json\/wp\/v2\/tags?post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}