No output please (cron)

  • stevem
  • Newbie
  • Newbie
  • stevem
  • Posts: 6
  • Loc: Uk

Post 3+ Months Ago

Ok can anyone out there give the correct syntax to tell cron to delete ALL output be it standard, bouncing email or what ever, can this be done ?

I have tried /dev/null 2>&1 but that does not bin bouncing email reports.

thanx in advance

STEVE (UK)
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

Well, technically that should work.
In an interactive shell, each program you run will have two "standard" output channels: stdout and stderr. Both of these channels will be directed to the tty associated with the interactive shell.

In this construct, stdout is directed to /dev/null, since that is the first redirection the shell received. Then, stderr is directed to the same destination as stdout, which is /dev/null.

Is this a shell script or perl you are running in cron?
Cheers.
  • stevem
  • Newbie
  • Newbie
  • stevem
  • Posts: 6
  • Loc: Uk

Post 3+ Months Ago

Well its a perl script that is a spam guard, if a valid return email cannot be returned with the challange then a "Could not send mail" email is generated and when you get 200 of these a week it builds up and I have to delete them in pine manualy. If I could get pine to delete them automaticly via cron then that would be ok but can not find out how to do that either.

STEVE
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

You can set up filtering in pine.
S for setup
R for rules
f for filtering
A for add filter
Name the filterby moving to the 'Nickname' option
C to change the name
Name it. :)
Arrow down to the "From pattern"
Press C to change the pattern to the appropriate email address
Return to accept the value you just entered
Use arrow keys to go down to each of the rules to be set.

Change as required.

Use the arrow keys to move to the option you want to select.
Put an asterisk in the box you want.

Filter Action - what you want to happen to messages from the email address you entered above
Use arrow key to your option.

Delete is probably what you want.
E to exit and Y and Y to save setup.

That should do it.
You can play with it to figure out which rules work best for you.
Starting it up etc can be done easily.

Cheers.
  • stevem
  • Newbie
  • Newbie
  • stevem
  • Posts: 6
  • Loc: Uk

Post 3+ Months Ago

Yea but can you get cron to do it ?
  • stevem
  • Newbie
  • Newbie
  • stevem
  • Posts: 6
  • Loc: Uk

Post 3+ Months Ago

Is there a cmd that I can use after the the run prog line like /p or somthing to make it run quiet with no output at all of any kind.
  • datona
  • Newbie
  • Newbie
  • datona
  • Posts: 8
  • Loc: Canada

Post 3+ Months Ago

Stevem,

You quoted:
Quote:
I have tried /dev/null 2>&1 but that does not bin bouncing email reports.


Make sure you have the following character also: >

You probably have:

0 12 * * * /file/to/run/runme.sh /dev/null 2>&1

but you should have:

0 12 * * * /file/to/run/runme.sh >/dev/null 2>&1


give that a try
  • stevem
  • Newbie
  • Newbie
  • stevem
  • Posts: 6
  • Loc: Uk

Post 3+ Months Ago

Thanx Scott I will

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 6 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.