Results 1 to 8 of 8

Thread: 2 questions about the WGET command

  1. #1

    Default 2 questions about the WGET command

    I'm using the "wget" command to get the date from Yahoo.com. So this is what I use on Solaris:

    /usr/sfw/bin/wget --timeout=3 -S Yahoo!

    This works well when my computer is linked to the Net. But when it's not, this command just hangs. I thought putting the timemout = 3 will make this command stop in 3 seconds, but it doesn't. Does anyone know what the exact command is to make this command stop after a few seconds if it can't make a connection to the Net?

    Also, when this command runs successfully, it creates a file called "index.html" What do I need to do so that it doesn't automatically create the file "index.html" in my local directory? Thanks.

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: 2 questions about the WGET command

    --tries=1 --timeout=3 works fine for me.

    If you don't want the content you can redirect it to /dev/null:

    Code:
    wget -O /dev/null blahblah

  3. #3
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    1,770

    Default Re: 2 questions about the WGET command

    I'm using the "wget" command to get the date from Yahoo.com
    Why are you using this to get date?
    openSUSE 12.3 (x86_64) with Kernel 3.7.10-1.16-desktop and KDE 4.11.2 on MacBook Pro
    Latest MS Windows version used: Win95

  4. #4

    Default Re: 2 questions about the WGET command

    Someone suggested it.

    Is there a simpler way to get the date from Yahoo?

  5. #5

    Default Re: 2 questions about the WGET command

    Why not use "date"?

  6. #6

    Default Re: 2 questions about the WGET command

    I cannot use "date" from the local UNIX station because if that date is changed, my script will have the wrong value.

    I need to get the date value from a site like Google.com, to ensure the date is correct.

  7. #7
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: 2 questions about the WGET command

    Why not use NTP?

  8. #8

    Default Re: 2 questions about the WGET command

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Agreed.... why do you think your computer's time will be out of sync?
    Unless you have a serious drift problem (unlikely) or you poweroff and
    have a bad CMOS battery (doesn't happen often) and also don't use NTP on
    startup your time should be accurate and the 'date' command will be a ton
    faster. Also chances are extremely high that your connection will be down
    more-often than your system date will (or should be) wrong. Yast: Network
    Services: NTP Configuration. Point to 'pool.ntp.org' if nothing else.

    Good luck.





    ken yap wrote:
    > Why not use NTP?
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iQIcBAEBAgAGBQJJ6+/mAAoJEF+XTK08PnB5YjYQAJtHyM3aZf2ujizmIPX5QrFe
    uplW4Nq5c6DiFuTL4Km2IKtzZ1e6ALi+SVzESW9HNo8PhPp45LkFNPRxZ5ur7NIo
    tNz1eRbFV1FGYm520Z5PHF8YYMSsPo6ITELslbShc6d05G4Tf60Oa21zYYP1IjYA
    jEdpE1uB0M+DcD5jYRSfvz+DsvI81HlNoETm3eRCzCtl9LtHCFOT97qnvcTNPZ/e
    PEKt/Q7ONGsOg+5WcuoyCNWsFTWVCdEuZbOsUnWpxhiLqv6DNIRi6nSIUw62HtDP
    hjZ7kEZ51Up6ZWfY2cjHtugOmqzgvbY4VXVvTOFqOal3sxss6xoGP8koohVReUj5
    3Rv/4RgejJlsWJwKew3vIESqiFDg8h1BPs5CMFeT2wW9vTMFG5UR8Zo+n3ysru6B
    7fzQbHJtKeGunWLRqmpflfcM0bNkSdznvND9/T7sDpCPHkFs092VZMWmWdBQOZye
    Tn9awuZ5f44s3E/0gaJbXGjOZ1Zy4bpVKxcHbgPZp5q8pSXeU7qNV0iymRc/yGtA
    UmrCiWfvseiZprJ/m5k+RZoNn3mxgz1j5ejNyPCF0SdlRVtzGUZcTmjREwsNY8Is
    Oyfcqmea+JHKjWCRP8SghY8C0mOxI7gYPeZogxkgVplGZD6AHrwYrpDqQAzVT1Qq
    VS5w6yE43cfjGfIcOmre
    =m4DE
    -----END PGP SIGNATURE-----

Posting Permissions

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