Question

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

Was it helpful?

Solution

You might also try this:

lynx -dump "http://www.example.com" > /dev/null

OTHER TIPS

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.

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 :-)

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 '...').

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top