I'm using the wget program, but I want it not to save the html file I'm downloading. I want it to be discarded after it is received. How do I do that?
|
|
|||
|
You can redirect the output of wget to /dev/null (or NUL on Windows):
The file won't be written to disk, but it will be downloaded. |
|||
|
|
|
If you don't want to save the file, and you have accepted the solution of downloading the page in If your real need is to trigger some remote action, check that the page exists and so on I think it would be better to avoid downloading the html body page at all. Play with
See the wget man page for further options to play with. |
|||||
|
|
|
||||
|
|
|
Another alternative is to use a tool like |
|||
|
|
|
Check out the "-spider" option. I use it to make sure my web sites are up and send me an email if they're not. This is a typical entry from my crontab:
|
|||
|
|
|
In case you also want to print in the console the result you can do:
|
|||
|
|
If you need to crawl a website using wget and want to minimize disk churn...For a *NIX box and using For crawling without writing to disk, the best I came up with is the following
Notice there is no Afterward, of course,
|
||||
|
|
|
Use the --delete-after option, which deletes the file after it is downloaded. Edit: Oops, I just noticed that has already been answered. |
|||
|
|
/dev/nullthing work? – Ram Rachum Oct 10 '09 at 2:23