0

I'm using a cpanel where I've hosted an application. In my application I have to run some queries on minutes/hourly/daily basis. For that I'm using cron job from cpanel. Here is a cron command that I'm using:

* * * * * wget -O /dev/null https://******/sms_cron

The problem in this command is, it is sending an email when it trigger. After searching for solution in online to stop sending email, I've found this command useful:

* * * * * wget https://******/sms_cron > /dev/null 2>&1

But there is a problem with this command too. Though it has stop sending email, but it is generating new file every time it trigger. Now I have to idea how to stop that too. Can anyone help me out with that?

Thank you.

5

To stop wget outputting anything, redirect its output to /dev/null and ask it to be quiet.

* * * * * wget -O /dev/null --quiet 'URL'

This is equivalent to

* * * * * wget -O - --quiet 'URL' >/dev/null

It will still produce output for actual errors (which I presume that you want to see). To avoid these as well, add 2>/dev/null to the end of the first command, or 2>&1 to the end of the second command.

2
  • I don't want to generate any file/sending any email, hopefully your solution will work. I will let you know. Thank you for your quick response – Alauddin Ahmed Apr 19 '20 at 8:04
  • Thanks,.. It worked – Alauddin Ahmed Apr 20 '20 at 5:29

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.