0
votes

I was just looking at our server root and one of our old developers who has left seems to have a cron job running daily which is writing a file every day to the server root.

I had a look at the daily cron jobs and I guess this is the culprit as it's the only wget (the others are PHP scripts which I know run silently):

wget http://www.example.com/?option=com_portal&view=ops&tmpl=component >/dev/null 2>&1

Each day the server root has a file like this written:

-rw-r--r--   1 root   root      11987 May 12 03:45 login.360
-rw-r--r--   1 root   root      11987 May 13 03:45 login.361
-rw-r--r--   1 root   root      11987 May 14 03:45 login.362
-rw-r--r--   1 root   root      11987 May 15 03:45 login.363

A new one for every day. The content of the file is the HTML page source. How can I safely modify the cron job to stop any output like this, until I do some further investigations into removing this cron job altogether?

1
Do crontab -e and comment (#) the offending line! - devnull
What does crontab -e do? I don't want to comment the line out yet as I haven't established the importance of the PHP script that is running (trying to decipher the spaghetti code and need to speak to some people who are not available at the moment). - BadHorsie
So you don't want to comment out the wget line, but you don't want the cron job to download the html page everyday via the wget line? Confused. - gogators
No I am just trying to safely establish what the developer and his script was trying to do first. The URL points to a component within a Joomla site, but the component is a full MVC app so the request goes through some routing - you cannot run the PHP script directly, which I guess is why he's done it as a wget. My question basically is how can I still request the page but prevent it from outputting it to the server root? - BadHorsie
I guess removing >/dev/null 2>&1 from the end will do. - Anubhab

1 Answers

1
votes

My question basically is how can I still request the page but prevent it from outputting it to the server root?

How about making wget dump the data to /dev/null?

wget -O/dev/null http://www.example.com/blab