• GoDaddy Community
  • VPS & Dedicated Servers
  • VPS & Dedicated Servers

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    New

    CRON Command Syntax

    I am trying to set up an automatic download of a ZIP file via a CRON command and am having an issue. Not sure if I have the correct directory /usr/bin/ or syntax. 

     

    Here is the command line -

    /usr/bin/wget 'http://3pv.mlslirealtor.com/Data3pv/DownloadBRSaction.asp?user_code=######&password=########&data_ty... -O '/home/ikeni11768/public_html/_brs/DATA.csv.zip'

     

    I get the file "DATA.csv.zip" but based on the small size it does not appear contain any info and gives me an "invalid file" error. Any help would be appreciated.

     

    Edit by Andy: Updated your snippet to remove identifiable information. Be careful when copying/pasting commands that contain sensitive credentials. 🙂

    1 REPLY 1

    "Not sure if I have the correct directory /usr/bin/ or syntax."

    $ which wget

    $ man wget

    "get the file "DATA.csv.zip" but based on the small size it does not appear contain any info and gives me an "invalid file" error. Any help would be appreciated."

    What if you try to run the script yourself? Create a shell script, using a shebang, and the command you're trying to execute.

    ---BEGIN FILE---

    #!/bin/sh

    # download zip

    /usr/bin/wget URL -O /home/ikeni11768/public_html/_brs/DATA.csv.zip

    # list content

    unzip -l /home/ikeni11768/public_html/_brs/DATA.csv.zip

    ---END OF FILE---

     

    Don't forget to set the executable bit and run,

    $ chmod +x script.sh

    $ ./script.sh

    Regards, R. Zelnick