7

I would like to change the following wget cron commands to curl format:

wget https://www.yoursite.com/index.php?route=cronjob/cronjob -O /dev/null

wget --quiet --delete-after "http://www.yoursite.com/index.php?route=cron/abandoned_cart_reminder&secret_code=yourcode"

Thank you!

BigMac
  • 81
  • 1
  • 1
  • 2
  • 1
    That's great, but what's your question? – Casey Falk Jul 30 '14 at 17:35
  • There are plenty of examples here to give you a starting point: http://www.thegeekstuff.com/2012/07/wget-curl/ – Casey Falk Jul 30 '14 at 17:37
  • I am asking for help to change the specific wget commands to curl commands. I have had a good look at a lot of the postings in this forum and others, and I have had issues in doing it myself that is why I have a separate post for it. – BigMac Jul 30 '14 at 17:58
  • Please clarify in your question. What are the "issues" that you're having? – Casey Falk Jul 30 '14 at 17:59
  • Issue: I am not familiar with wget and curl commands. I have two wget commands that I would like to change into curl commands. I am not sure how much clearer I can get. – BigMac Jul 30 '14 at 18:40
  • I posted an answer to explain for ye'. Also, this stuff is available in the docs for each command. – Casey Falk Jul 30 '14 at 19:01

1 Answers1

13

The commands wget and curl can be used (fairly) similarly if you just want to download something from a URL. Note that the following is available in the man documentation for each command.

Syntax

wget [options] [URL]
curl [options] [URL]

Options

To specify a download location, wget uses -O while curl uses -o.

To silence output, wget uses --quiet while curl uses --silent.

To delete every file that is downloaded upon completion, wget uses --delete-after. I don't believe curl has a related option (or it may do this automatically).


So a direct translation of your first command would be:

wget https://www.yoursite.com/index.php?route=cronjob/cronjob -O /dev/null
curl https://www.yoursite.com/index.php?route=cronjob/cronjob -o /dev/null

Make sense?

There are lots of examples online and extensive documentation on the man page for each command.

Casey Falk
  • 2,617
  • 1
  • 18
  • 29