/dev/null 2>&1" work?" />
A
A
aopil2021-12-22 17:09:13
ubuntu
aopil, 2021-12-22 17:09:13

Why doesn't ">/dev/null 2>&1" work?

I set up a Cron job, it works, but retains garbage, which seems to be not there)
61c3313337d4f475120925.png

61c3317ca8250112323287.png

The question is what's wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Karabanov, 2021-12-22
@aopil

Use curl:curl -o /dev/null -sL http://myurl.com

P
pfg21, 2021-12-22
@pfg21

So everything is correct. By default, wget writes to a file with a name formed from the http parameters.
in order to redirect the downloaded stream to stdout, you must use the option to write to a named file and instead of the name, shove -
-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 -.)
In your case, you can generally send both the log and the document to devnull at once.
wget -o /dev/null -O /dev/null ******

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question