- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- cron script - unwanted e-mail generated
Operating System - Linux
1753545
Members
5851
Online
108795
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2010 10:49 AM
тАО01-28-2010 10:49 AM
cron script - unwanted e-mail generated
Hello all,
I have this little script that is triggered by oracle's crontab on a redhat virtual server. The script works fine because I can verify results but it generates a Mail message every time it runs. I want to eliminate the Mail messages.
The following crontab entry was created by "crontab -e" as the oracle user:
"0-59/5 * * * 0-6 /u01/oracle/SCRIPTS/copy_archivelogs_to_nbcseprd_DR.sh > /dev/null"
The Mail message looks like:
Message 61:
From oracle@db13.xxx.ca Thu Jan 28 04:30:02 2010
Date: Thu, 28 Jan 2010 04:30:01 -0400
From: root@db13.xxx.ca (Cron Daemon)
To: oracle@db13.xxx.ca
Subject: Cron /u01/oracle/SCRIPTS/copy_archive
logs_to_nbcseprd_DR.sh > /dev/null
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
<< the system, the client represents that he or she is an authorized client.
Ce systeme ne doit etre utilise par des clients autorises. En continuant
d'utiliser le systeme, le client affirme qu'il est un client autorise.>>>
where the text that is shown between the <<< and >>> is the contents of the /etc/issue file that is displayed at logon time.
Questions:
1- Is the message generated by :cron: or by the :sh: command that is executed on the :find: command output?
2- How can I get rid of that mail message?
I still want to know if the script failed.
3- Can someone clearly explain the -exec constuct found in the :find: command?
I know it moves files to the MOVED_TO_DR but I have no idea where the "find-copy" comes from and what the + means.
Thanks
Rayb
I have this little script that is triggered by oracle's crontab on a redhat virtual server. The script works fine because I can verify results but it generates a Mail message every time it runs. I want to eliminate the Mail messages.
The following crontab entry was created by "crontab -e" as the oracle user:
"0-59/5 * * * 0-6 /u01/oracle/SCRIPTS/copy_archivelogs_to_nbcseprd_DR.sh > /dev/null"
The Mail message looks like:
Message 61:
From oracle@db13.xxx.ca Thu Jan 28 04:30:02 2010
Date: Thu, 28 Jan 2010 04:30:01 -0400
From: root@db13.xxx.ca (Cron Daemon)
To: oracle@db13.xxx.ca
Subject: Cron
logs_to_nbcseprd_DR.sh > /dev/null
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
<<
Ce systeme ne doit etre utilise par des clients autorises. En continuant
d'utiliser le systeme, le client affirme qu'il est un client autorise.>>>
where the text that is shown between the <<< and >>> is the contents of the /etc/issue file that is displayed at logon time.
Questions:
1- Is the message generated by :cron: or by the :sh: command that is executed on the :find: command output?
2- How can I get rid of that mail message?
I still want to know if the script failed.
3- Can someone clearly explain the -exec constuct found in the :find: command?
I know it moves files to the MOVED_TO_DR but I have no idea where the "find-copy" comes from and what the + means.
Thanks
Rayb
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2010 11:30 AM
тАО01-28-2010 11:30 AM
Re: cron script - unwanted e-mail generated
Hi Raynald
try the following:
0-59/5 * * * 0-6 /u01/oracle/SCRIPTS/copy_archivelogs_to_nbcseprd_DR.sh >/dev/null 2>&1
This ensures that all output (stdout/stderr) goes to dev/null.
Hope that helps
Keith
try the following:
0-59/5 * * * 0-6 /u01/oracle/SCRIPTS/copy_archivelogs_to_nbcseprd_DR.sh >/dev/null 2>&1
This ensures that all output (stdout/stderr) goes to dev/null.
Hope that helps
Keith
Arse-cover at all costs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2010 11:43 AM
тАО01-28-2010 11:43 AM
Re: cron script - unwanted e-mail generated
I thought about that but I wish to get mail when the script fails.
Won't that defeat that purpose?
Won't that defeat that purpose?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2010 03:34 PM
тАО01-28-2010 03:34 PM
Re: cron script - unwanted e-mail generated
Raynald
What is the function of this script? If you have a find statement within the script, then you should error-check and send an alerting email from the script itself. Why not post it here and we can make suggestions? You can obviously trap your script output to something else other than /dev/null, say for example:
0-59/5 * * * 0-6 /u01/oracle/SCRIPTS/copy_archivelogs_to_nbcseprd_DR.sh >>/tmp/script.log 2>&1
but you will then need another script to monitor your logfile (/tmp/script.log in this example). You can set a non-zero exit code when the script fails (on completion) and this return code is stored in the cron log, but again, you need another script to detect/monitor this.
All the best - Keith
What is the function of this script? If you have a find statement within the script, then you should error-check and send an alerting email from the script itself. Why not post it here and we can make suggestions? You can obviously trap your script output to something else other than /dev/null, say for example:
0-59/5 * * * 0-6 /u01/oracle/SCRIPTS/copy_archivelogs_to_nbcseprd_DR.sh >>/tmp/script.log 2>&1
but you will then need another script to monitor your logfile (/tmp/script.log in this example). You can set a non-zero exit code when the script fails (on completion) and this return code is stored in the cron log, but again, you need another script to detect/monitor this.
All the best - Keith
Arse-cover at all costs
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP