Does the cron wget -q command create a file on the server?

I currently have one php function that works with cron. This is the function of checking the timestamp and closing the topic. To check the timestamp and do a live update, I have to use cron. I run cron with this command

wget -q http://www.example.com/program/timecheck 

Everything works fine, so I have not tested my server for quite some time. But today I checked and found out that over 500,000 files called timecheck were created in the root directory.

I checked the code and I'm sure that there is no code to create the file.

What I would like to know is because of the wget -q command? If this is, what command should I use to execute the URL?

Thank you for your help.

Yours faithfully,

+4
source share
2 answers

Assuming it's a Linux-like OS,

 wget -O /dev/null -q http://www.example.com/program/timecheck 

A file is the output from wget. This option ( -O ) tells her to write the output to /dev/null , discarding it.

+21
source

yes, by default wget will save the file and it will create a version of the application to download the file to avoid forced replacement

-q just disables verbose message

you can override this with: -

 wget -O /tmp/log.file ${url} // this will always replace the /tmp/log.file 
+1
source

Source: https://habr.com/ru/post/1382937/


All Articles