Results 1 to 2 of 2

Thread: Unable to set a cron job

  1. #1
    Join Date
    Dec 2018
    Posts
    1

    Unable to set a cron job

    Hello everyone,

    I'm trying to set a cron job with parameters.
    DA gives you some examples that you can follow. I chose this one:
    /usr/bin/wget -O /dev/null http://www.domain.com/cron.php

    In order to send parameters, I simply tried this:
    /usr/bin/wget -O /dev/null http://www.domain.com/cron.php?par1=par1&par2=par2

    My script stops at the first parameter though, the other are completely ignored.
    Looking on the internet, I found out that the right way to send parameters is the following:
    /usr/bin/wget -O /dev/null http://www.domain.com/cron.php par1=par1 par2=par2

    Through shell, this is the result:
    --2018-12-30 17:14:20-- http://par1=par1/
    Resolving par1=par1 (par1=par1)... failed: Name or service not known.
    wget: unable to resolve host address ‘par1=par1’
    --2018-12-30 17:14:20-- http://par2=par2/
    Resolving par2=par2 (par2=par2)... failed: Name or service not known.
    wget: unable to resolve host address ‘par2=par2’

    What am I missing? 🤔 I feel like this is a very noob question!

    Thank you in advance!
    Andrea

  2. #2
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,858
    Hello Andrea,

    Try to use quote-marks:


    Code:
    /usr/bin/wget -O /dev/null "http://www.domain.com/cron.php?par1=par1&par2=par2"
    Alex Grebenschikov

    - You can hire me on www.poralix.com to work on your server
    - Follow and like @Poralix on Facebook

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •