views:

410

answers:

4

Hello!

When I try to run a script by cron I get this error messaege:

/bin/sh: get: command not found

I also tried it in bash shell, and I tried 'curl', 'wget' and 'fetch' but non of them helped.

Can anybody tell solution? : D

A: 

What OS, and what is the script that you're trying to run?

If it's trying to fetch a file from a url, try substituting get with wget. That might work.

Vivin Paliath
The script just sends a mail, and I forgot it from my question that I tried wget too.
Arnold
A: 

Linux

/usr/local/bin.something.sh:

#!/usr/bin/env bash

# Some script ehere

Crontab:

00 *    * * *   root    /usr/local/bin/something.sh

All elements should be listed above :-)

Notinlist
A: 

cron(8) uses sh(1) to execute commands. The environment that sh(1) sees might not be the environment that you see interactively. If so, then you can enhance the profile files to obtain the same environment or have cron(8) execute a command that obtains the correct environment (e.g., "bash -l -c '...').

Steve Emmerson
+3  A: 

You might also try this:

lynx -dump "http://www.example.com" > /dev/null
tambler
Thanks, that was the solution. : )
Arnold
Can I get some vote love? :)
tambler