How to pass multiple parameters to cron job with curl?

Yeti picture Yeti · Jun 5, 2010 · Viewed 58.3k times · Source

I'm running two cron jobs:

This one executes without a problem:

curl -sS http://example.com/cronjob.php?days=1

But this doesn't run at all:

curl -sS http://example.com/cronjob.php?days=1&month=1

Is this because of the ampersand (&)? If yes, how to pass multiple parameters?

Using argv is not an option.

Answer

SamB picture SamB · Jun 5, 2010

You'll notice that this doesn't exactly work in your shell, either.

What you need to do is put single quotes around the URL, like so:

curl -sS 'http://example.com/cronjob.php?days=1&month=1'