06-08-2011
how to run a script using cron job and send the output as attachment via e-mail using unix
how to run a script using cron job and send the output as attachment via e-mail using unix. please help me.
how my cron job entry should be?
As of now my cron job entry is to run the script at specific time,
15 03 * * * /path/sample.sh | mail -s "Logs" email_id
In the above entry, what i have to change inorder to send the output file also as the attachment.
output file name is output.gz
Thanks in Advance!
10 More Discussions You Might Find Interesting
1. AIX
I apoligize for the cross-post but I'm not getting much in the way of help in the dummies forum:
I'm trying to script sending an e-mail message on an AIX 5.x server with the following requirements:
1. command line switch to specify file name containing message body in HTML format
2. command... (3 Replies)
Discussion started by: G-Man
3 Replies
2. Shell Programming and Scripting
Hello,
I need a shell script which need to send a mail with 4 *.csv files as attachments.Anybody can help me?
At present i have a script which is sending only one file as attachments.But i need a script which send 4 files in a shot.
#!/bin/ksh
/bin/mail xxxx@xx.xom << EOF
Subject:... (4 Replies)
Discussion started by: Mar1006
4 Replies
3. Shell Programming and Scripting
hi,
i have the code as below
#!/bin/sh
MAIL=/usr/bin/Mail
Mail_addr="aaa@bb.com"
Mail_file="/home/delta/dev/aa.doc"
${MAIL} -s " health check" ${Mail_addr} < ${Mail_file} (6 Replies)
Discussion started by: mail2sant
6 Replies
4. Shell Programming and Scripting
Hi,
I have the below code for sending email from AIX unix.
I need the body of the mail should content of errornotify.txt file. i tested with cat errornotify.txt, it is not working...Also i need multiple attachments.
Can you please help me out on this.
(
echo "From:cus@xxx.xx.com"
echo... (3 Replies)
Discussion started by: rsivasan
3 Replies
5. Shell Programming and Scripting
Hi i created a cron job which invoke a shell script and output some content via email.
Some times these output are sent to the junk email folder. i want these mails to be sent to inbox with some specific font. what i have to do? (4 Replies)
Discussion started by: vidhyaS
4 Replies
6. Shell Programming and Scripting
Hi All,
Is it possible to send mail in Unix with attachment.
If yes, then how?? (8 Replies)
Discussion started by: parthmittal2007
8 Replies
7. AIX
Dear All,
Would some one help me with this to send a file as attachment in a mail using a script without uuencode...
I am working on AIX 6.1, the thing is I dont have uuencode available... Is there any other alternate possible way to send file attachment with the mail without using uuencode... (11 Replies)
Discussion started by: msmadhan11
11 Replies
8. Shell Programming and Scripting
I get a different output when i manually run the .sh script and when it is run by a cron job. Please help me ..
TMP1="/lhome/bbuser/script/wslog/sar.t1"
TMP2="/lhome/bbuser/script/wslog/sar.t2"
TMP3="/lhome/bbuser/script/wslog/sar.t3"
OUTPUT="/lhome/bbuser/script/wslog/sar.out"... (8 Replies)
Discussion started by: nithinankam
8 Replies
9. Shell Programming and Scripting
Team,
Would like to know what is the best script that will send you an email if cronjob did not run.
Thanks (4 Replies)
Discussion started by: kenshinhimura
4 Replies
10. Shell Programming and Scripting
Hi Guys,
I am very new to shell script and I need your help here to write a script. Actually, I have a script abc.sh which don't get terminated itself. So I need to design a script to run this script, save the output to a file, search for a given string in the output and if it exists send those... (11 Replies)
Discussion started by: Sambit Sahu
11 Replies
cron(8) System Manager's Manual cron(8)
NAME
cron - The system clock daemon
SYNOPSIS
/usr/sbin/cron
DESCRIPTION
The cron daemon runs shell commands at specified dates and times. Commands that are to run according to a regular or periodic schedule are
found within the crontab files. Commands that are to run once only are found within the at files. You submit crontab and at file entries
by using the crontab and at commands. Because the cron process exits only when killed or when the system stops, only one cron daemon
should exist on the system at any given time. Normally, you start the cron daemon from within a run command file.
During process initialization and when cron detects a change, it examines the crontab and at files. This strategy reduces the overhead of
checking for new or changed files at regularly scheduled intervals. The cron command creates a log of its activities. The cron daemon
must be started from the system startup scripts because it must begin execution without a login user ID set. The cron daemon starts each
job with the following process attributes stored with the job by the invoking process: Login user ID Effective and real user IDs Effective
and real group IDs Supplementary groups
It also establishes the following attributes from the authentication profile of the account associated with the login user ID of the invok-
ing process: Audit control and disposition masks Kernel authorizations
DIAGNOSTICS
The at and batch programs will refuse to accept jobs submitted from processes whose login user ID is different from the real user ID.
FILES
Specifies the command path. Main cron directory Directory containing the crontab files. List of allowed users. List of denied users His-
tory information for cron Queue description file for at, batch, and cron
RELATED INFORMATION
Commands: at(1), crontab(1), rc0(8), rc2(8), rc3(8)
Files: queuedefs(4) delim off
cron(8)