convert wget cron command to curl

10,456

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.

Share:
10,456
Admin
Author by

Admin

Updated on June 27, 2022

Comments

  • Admin
    Admin almost 2 years

    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!

  • SkorpEN
    SkorpEN about 3 years
    in my case I replaced with curl myadres >> outName.sh