Cron job wget dev null




















It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search. On my Ubuntu-Desktop and on my debian-server I have a script which needs to be executed each minute a script that calls the minute-tic of my space online browsergame. But I would like to run a cronjob and be sure that all generated output or errors are piped to NULL, so it doesn't generate any messages in syslog and doesn't generate any emails.

Can I somehow only redirect a single cronjob to a separate log file? Preferably configurable inside the cron. These are simply notifications via cron that a directory of cronjobs was executed. This message has nothing to do directly with these jobs, instead it's coming from the crond daemon directly. There isn't really anything you can do about these, and I would encourage you to not disable these, since they're likely the only window you have into the goings on of crond via the logs.

Since nothing you do seems to stop this, it is worth asking: what exactly is this script and what exactly is the message you see in syslog? If slm's suggestion did not work, this is because something is logging to syslog directly -- either cron, as seems to be implied in some of your comments, or else the process run by cron. There might be a way to configure the behavior of the application in question, except we don't know what it is. There certainly is a way to configure most contemporary syslog implementations there are several to filter messages very specifically.

For example, if there is a unique tag used in the log message, you can target that. But again, since we don't know anything about the particular message, or which syslogd you use, then there's nothing specific that can be recommended.

Debian and Ubuntu both have rsyslog available. To create a filter that targets some kind of specific content, place this near the top i. Best way to do this is not to edit the rsyslog.

You can put there something like this:. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Asked 7 years, 2 months ago. Active 1 year, 9 months ago. Viewed k times. Improve this question. Add a comment. Active Oldest Votes. Improve this answer. Stephen Kitt k 45 45 gold badges silver badges bronze badges. What if the command that I run in the crontab file do not output anything?

In this case, I don't need to add that, right? AwQiruiGuo That's correct. A mail is delivered only when there is output on stdout or stderr. As far as I can tell from the documentation, the only difference between running wget from a terminal and otherwise is whether a progress bar is displayed. Add a comment. Active Oldest Votes. Improve this answer. I appreciate it. Nacht Nacht 1 1 silver badge 10 10 bronze badges. That's a good thought. I really only need the OK response.

I was hoping somebody unbiased would point it out, but My answer is really the correct way to do this : — Nacht. Peter Lamby Peter Lamby 1 1 silver badge 3 3 bronze badges. In sh , which is usually what cron uses, the ampersand redirect does not work. You say you only need the " OK" response in a comment. Combining that, wget will neither output anything to stderr, nor save a document.

Volker Siegel Volker Siegel 9 9 bronze badges. I like this approach as well. I appreciate your feedback and answer. May your question should be about this, the webpage says: A fast and robust web server and application server for This shouldn't require any keepalive scripts.

Otherwise kasperd's solution is perfect. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science.

Stack Gives Back Featured on Meta.



0コメント

  • 1000 / 1000