Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5973699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:50:13+00:00 2026-05-22T20:50:13+00:00

I am completely baffled by the behaviour of cron under Mac OS 10.6 Server.

  • 0

I am completely baffled by the behaviour of cron under Mac OS 10.6 Server. I am trying to run two scripts in a cronjob like this:

00 16 * * * /Users/myusername/script.sh
04 16 * * * /Users/myusername/crontest.sh

While ‘script.sh’ contains a wget command:

#!/bin/sh
wget -r -l3 --no-parent -nc -A ".shtml" 'http://some.url/somethingelse/'

‘crontest.sh’ contains just a test script:

echo "hi" >> /Users/myusername/crontest.txt

Problem is, ‘script.sh’ does not fire, but ‘crontest.sh’ does. What could be the cause of the wget script not firing? Do the scripts require a specific encoding? Does cron write a log file somewhere?

(I tested the wget command by itself in the shell, where it works fine.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:50:14+00:00Added an answer on May 22, 2026 at 8:50 pm

    cron runs scripts with a very minimal environment. In particular, its PATH doesn’t contain all of the usual binaries directories, just /usr/bin and /bin, so any commands in other binaries directories (like wget) will not be available.

    There are several ways to fix this. One option is to have your script give the complete path of wget:

    #!/bin/sh
    /usr/local/bin/wget -r -l3 --no-parent -nc -A ".shtml" 'http://some.url/somethingelse/'
    

    (or whatever its actual path is — use which wget to find out.)

    Another is to explicitly set PATH in the script:

    #!/bin/sh
    PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
    wget -r -l3 --no-parent -nc -A ".shtml" 'http://some.url/somethingelse/'
    

    (or whatever PATH you normally use; be sure it includes wget’s location.)

    Or you can set the PATH in your crontab:

    PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
    00 16 * * * /Users/myusername/script.sh
    04 16 * * * /Users/myusername/crontest.sh
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm completely baffled by observing this behaviour in my F# code, here taken from
I am completely baffled by this as I have coded several other methods using
This is super simple and I'm completely baffled by this behavior. I want my
I am completely baffled by this and don't fully understand IE7's problem. The page
Specifically a Multigraph . Some colleague suggested this and I'm completely baffled. Any insights
I am completely baffled as to why this simple jQuery script is not working.
Completely new to most of this stuff, but basically Im playing around with the
Not completely a programming question, but its close enough so here goes: In Mac
The line below is completely failing. template: _.template($('#test').html()), Trying to follow a simple example
I'm completely new to javascript, but I'm trying to create a beta form for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.