- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- crontab HP-UX
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
02-02-2015 01:42 AM
02-02-2015 01:42 AM
crontab HP-UX
Hello every one,
My case is the following... I have configured my crontab for send email with aliases:
##
# Alias for mailer daemon
MAILER-DAEMON : root
root : l-sistemas.cron.ced@mydomain.com
# RFC 822 requires that every host have a mail address "postmaster"
postmaster : root
# Aliases to handle mail to msgs and news
nobody : /dev/null
# System Admistration aliases
operator : root
uucp : root
daemon : root
# Ftp maintainer.
ftp-bugs : root
# Local aliases
- When I make a cron job, I receive TWO emails, when I have only one with a subjets, let me show you my job in crontab:
40 4 * * * /export/backup/programas/sv0011/PortalAverroes-backup-NETBACKUP.sh | mailx -s "PortalAverroes-backup-NETBACKUP" root >/dev/null 2>&1
- Like you see, I want receive the output of the script "PortalAverroes"; in fact I receive this, but twice:
First email with subject like I want: "PortalAverroes-backup-NETBACKUP"
Second email with subject like i dont want: "[l-sistemas.cron.ced@mydomain.com] cron"
Do you know how resolv this condition??
In fact I tried place a { >/dev/null 2>&1 } condition, but in the body of the email of "cron" I receive the output like this:
************************************************* Cron: El mensaje anterior es la salida estándar y el error estándar de uno de sus comandos crontab: /export/backup/programas/puck/salva-NETBACKUP.sh | mailx -s "Archivado de archivelog oracle y wal postgresql" root >/dev/null 2>&1
Thanks a lot.
- Tags:
- cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2015 10:23 AM - edited 02-02-2015 10:46 AM
02-02-2015 10:23 AM - edited 02-02-2015 10:46 AM
Re: cron sending mail
>When I make a cron job, I receive TWO emails
You have two commands in your pipeline. With 4 outputs and one of those is sent as stdin to mailx(1).
You are handling the stdout/stderr for mailx but not stderr for your script.
So you either need to redirect or duplicate it:
PortalAverroes-backup-NETBACKUP.sh 2>&1 | mailx -s "PortalAverroes-backup-NETBACKUP" root >/dev/null 2>&1
So it is cron(1m) that is sending that second mail, which would be more obvious to everyone if the message was in English.
- Tags:
- redirect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2015 03:11 AM
02-05-2015 03:11 AM
Re: cron sending mail
This works!
Thanks!