03-19-2002
If all you are looking for is email from a failed cron job, then using the redirect would be simplier.
Two cron jobs - one has an error in the entry - this would be the same as a script running and sending back an error. The first never sends output to you because it doesn't error (normally). The second sends email because the syntax is wrong.
[tghunter@medusa]:/export/home/unixops
$ crontab -l
* * * * * date > /dev/null 2>&1
* * * * * date '+ %m%d%h' > /dev/null 2>&1
$ date
Tue Mar 19 09:17:10 EST 2002
[tghunter@medusa]:/export/home/unixops
$ mail
No mail.
[tghunter@medusa]:/export/home/unixops
$ sleep 50
[tghunter@medusa]:/export/home/unixops
$ mail
From unixtst Tue Mar 19 09:19:00 2002
Date: Tue, 19 Mar 2002 09:19:00 -0500 (EST)
From: Unix OPS <unixtst>
Message-Id: <200203191419.g2JEJ0Y00592@medusa.tampa.intermedia.com>
To: unixtst
Subject: Output from "cron" command
Content-Length: 71
Your "cron" job on medusa
date '+
produced the following output:
? q
10 More Discussions You Might Find Interesting
1. Solaris
Getting ready for Sarbanes Oxley and I was told that I need to create a cron.allow file for the box so that only specified users can create cron jobs. That was easy enough, and I put in all the accounts that had scheduled cron jobs such as:
root
lp
My oracle account
A couple of programmer... (1 Reply)
Discussion started by: citrowske
1 Replies
2. UNIX for Dummies Questions & Answers
I have two different cron jobs that run on the same days. The jobs are 7 hours apart. Both jobs are set to send notification emails when they start running.
Both jobs always run successfully, but I only receive an email from the first job. I never get the email from the second job.
... (0 Replies)
Discussion started by: sasaliasim
0 Replies
3. Shell Programming and Scripting
Hi
Im very new at working with unix and this problem I simply can not understand. I know there are a lot of threads about problems with shell scripts behaving differently when run from a terminal and from a cronjob. I have tried everything(almost) but I still havent cracked this problem.
Im... (15 Replies)
Discussion started by: Nightowl
15 Replies
4. Shell Programming and Scripting
I have a very basic script that essentially sends a log file, via FTP, to a backup server. My cron entry to run this every night is:
55 23 * * * /usr/bin/archive_logs
The script runs perfectly when executed manually, and actually worked via cron for about three weeks. However, it mysteriously... (3 Replies)
Discussion started by: cdunavent
3 Replies
5. Shell Programming and Scripting
Hello,
I have added the following entry in my cron file:
* * * * * . /home/texprd/.profile>/dev/null 2>&1; echo "test" >> /home/texprd/test.log 2>&1
The cron fails ie the added command fails to append "test" in the test.log file. However if I run the command manually from the shell... (3 Replies)
Discussion started by: mahive
3 Replies
6. UNIX for Dummies Questions & Answers
Im having a problem with my ftp CRON jobs. I have another related (but not the same question in shell scripting).
My FTP CRON jobs connect to a server and drop some files off, if for some reason it cannot connect to the server (timesout/password wrong etc) instead of stopping, it tries again... (3 Replies)
Discussion started by: mokachoka
3 Replies
7. UNIX for Advanced & Expert Users
I added a shell script to cron that executes every 5-15 minutes. It's used to monitor multiple environments, so it has to ssh to each machine to check the status of that machine. Sometimes, I may have more than one instance of this script running at the same time. So, here's my problem. I've... (2 Replies)
Discussion started by: mrwatkin
2 Replies
8. Red Hat
Hi Guys...
I have a bulk email program that sends out an email to a subscribed mail list.
The list contains around 2000 addresses.
My server is Centos 5 64bit
PHP 5.2
Mysql 5.1
The program is set to send emails in batches of 100.
Cron is set to run every minute
Now for the problem:... (2 Replies)
Discussion started by: countrydj
2 Replies
9. Shell Programming and Scripting
Hi,
When run the script directly...it executes as expected. But when put it in crontab the job fails with this error:
Connection not open
08003: Connection not open
Unable to connect to the database...
how come it is not able to connect when cron job fires?... Do I need to... (7 Replies)
Discussion started by: nuthakki
7 Replies
10. Shell Programming and Scripting
Hi,
Below is my script which sends out emails.
more test.sh
1 #!/bin/ksh
2 {
3 print "From: Prod@mycomp.com"
4 # print "From: Prod@`hostname`.com"
5 # print "From: Prod@${HOSTNAME}.com"
6 print "To: me@mycomp.com"
7 print "Subject:... (5 Replies)
Discussion started by: mohtashims
5 Replies
LEARN ABOUT DEBIAN
mailping-cron
2004-04-15
mailping
0.0.4
MAILPING-CRON(1) Mailping MAILPING-CRON(1)
NAME
mailping-cron - run periodic processing to test email service availability and functioning
SYNOPSIS
mailping-cron
DESCRIPTION
mailping-cron processes incoming emails, updates status and sends out probe messages.
The idea is to configure multiple email "circuits", send probe messages regularly, and see whether they complete the circuit and how long
it took.
Setting up a circuit
1. Give a name to the circuit, hereafter referred to as circuit.
2. Arrange for a local email address to be delivered to maildir /var/lib/mailping/state/circuit/incoming/. See mailping-store.
3. Create a configuration for the circuit, by creating directory /etc/mailping/circuit.
If you need non-default sender and/or recipient addresses, create files from and to there, containing the sender and recipient
addresses suitable for the circuit.
4. You're done! Munin should now see the data.
Testing multiple servers
To test functioning of more than one email server, arrange an email alias at a remote site pointing to an address on your server, and set
the address of that alias here.
Here's an example of testing a system consisting of two email servers and everything in that path (smarthosts, primary MXs, virus checkers,
etc.):
Local address <mailping+that@this.example.com> is delivered with mailping-store to /var/lib/mailping/state/that/incoming/.
Remote address <echo@that.example.com> is an alias that redirects all email to <mailping+that@this.example.com>.
/etc/mailping/that/to is set to <echo@that.example.com>.
FILES
/etc/mailping/circuit/from
Sender address for the probe emails. Default: <currentuserid@fullyqualifiedhostname>.
/etc/mailping/circuit/to
Recipient address for the probe emails. You must arrange for the email to eventually get delivered to the maildir
/var/lib/mailping/state/circuit/incoming/. mailping-store will probably be useful in that. Default:
<currentuserid+circuit@fullyqualifiedhostname>
/etc/mailping/circuit/admin
Admistrative address, set as Reply-To in probe messages. Default: do not add Reply-To.
/etc/mailping/circuit/interval
How often a probe message is sent, in seconds. Default: 600 seconds.
/var/lib/mailping/state/circuit/
Stored state for the probing.
/var/lib/mailping/state/circuit/junk/
Maildir used to store all messages in incoming that do not look like probe messages. Read and delete them regularly.
/var/lib/mailping/state/circuit/broken/
Maildir used to store all messages in incoming that do look like probe messages, but a corresponding pending entry cannot be found.
Duplicated probe messages cause these. Read and delete them regularly.
ENVIRONMENT
MAILPING_CONFIGDIR
Override the location of the configuration directory. Default: /etc/mailping
MAILPING_STATEDIR
Override the location of the state directory. Circuit states are stored in the state subdirectory of this directory, in subdirectories
named after the circuit name. Default: /var/lib/mailping
SEE ALSO
mailping-store(1), mailping-success(1), mailping-latency(1)
AUTHOR
Tommi Virtanen <tv@havoc.fi>
Havoc Consulting
Author.
COPYRIGHT
Copyright (C) 2004 Havoc Consulting
mailping 0. 2004-04-15 MAILPING-CRON(1)