0

Below image link shows the cron job that we have setup which is creating the log file in the root every minute.

click here to view cronjob

I am on a shared server and I do not wish to have the log files or else it will load up the server very quickly. It creates the files such as schedulesms.1, schedulesms.2, etc and so on.

Can you please provide me a way to ensure it does not create the log files.

0

The files you are seeing are not cron but wget output. The most common use of wget output is fetching web pages on disk.

Whilst you are redirecting stdin and stdout, you did not account for the wget usage of saving web pages.

If you just want to access that URL, you may ask wget not to save any output with the -q quiet option.

Per man wget:

-q
--quiet Turn off Wget's output.

I would also prefer not having a cron job on a shared server running every minute, and would run at the minimum every 5 minutes, as in:

*/5 * * * * wget -q http://yoururl > /dev/null 2>&1
  • 1
    I got this from my host wget -O /dev/null url and now it is not creating any more files and the cron job is also running. Thanks for your answer @Rui F Ribeiro though. – Keyur Amin May 30 '18 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.