Could someone please post an example of how to use wget properly in the crontab file? This would be helpful.
Is the following line correct?
wget -0 index.html='/usr/bin/wget'
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- ‘-O file’
- ‘--output-document=file’
- The documents will not be written to the appropriate files, but all will be concatenated together and written to file. If ‘-’ is used as file, documents will be printed to standard output, disabling link conversion. (Use ‘./-’ to print to a file literally named ‘-’.)
- Brent Cochran@Brentc11
Brent Cochran - 0 likes
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- Brent Cochran@Brentc11
Brent Cochran - 0 likes
- Cash@costelloc
Cash - 0 likes
You must log in to post replies.Use of ‘-O’ is not intended to mean simply “use the name file instead of the one in the URL;” rather, it is analogous to shell redirection: ‘wget -O file http://foo’ is intended to work like ‘wget -O - http://foo > file’; file will be truncated immediately, and all downloaded content will be written there.
For this reason, ‘-N’ (for timestamp-checking) is not supported in combination with ‘-O’: since file is always newly created, it will always have a very new timestamp. A warning will be issued if this combination is used.
Similarly, using ‘-r’ or ‘-p’ with ‘-O’ may not work as you expect: Wget won't just download the first file to file and then download the rest to their normal names: all downloaded content will be placed in file. This was disabled in version 1.11, but has been reinstated (with a warning) in 1.11.2, as there are some cases where this behavior can actually have some use.
Note that a combination with ‘-k’ is only permitted when downloading a single document, as in that case it will just convert all relative URIs to external ones; ‘-k’ makes no sense for multiple URIs when they're all being downloaded to a single file.
Thanks for the info, but I was really just wanting to know the proper way to implement the following suggestion from the documentation cron page.
@Brent
You make it sound more like you are offering tecnical help rather than asking for help..
LOL ;-)
Would the follow be the right form of the command for the location of GET using wget?
GET='/usr/bin/wget -O'
for the the example crontab.
The documentation doesn't describe the best option. I'll update that.
If your wget executable is in /usr/bin, try
GET='/usr/bin/wget --spider'