Sponsored Content
Top Forums Shell Programming and Scripting how to run a script using cron job and send the output as attachment via e-mail using unix Post 302528902 by vidhyaS on Wednesday 8th of June 2011 07:30:43 AM
Old 06-08-2011
Thanks for the quick reply!

i just integrated the pattern in my script,
(cat /path/log_file ; uuencode /path/log_file log_file) | mailx -m -s "Logs" email_id

but the following error thrown,
Code:
mailx: invalid option -- m
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
            [-- sendmail-options ...]
       mail [-iInNv] -f [name]
       mail [-iInNv] [-u user]
/path/sample.sh: line 47: uuencode: command not found


Am using Bash shell script!

Last edited by Franklin52; 06-09-2011 at 03:32 AM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. AIX

Command line/Script to send E-mail with HTML body and binary attachment

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

Script needed which will send a mail with attachment files

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

how to send a attachment mail in unix

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

send mail from AIX unix with multiple attachment

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

how to avoid cron job output to send to the junk email folder?

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

How to send mail with attachment in Unix

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

Need to send attachment in Mail without using uuencode via script in AIX6.1

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

Output differs when run manually and when cron job executes it

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

Script that will send an email if the cron job did not run.

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

A shell script to run a script which don't get terminated and send a pattern from the output by mail

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
USERDB(8)						      Double Precision, Inc.							 USERDB(8)

NAME
userdb - manipulate /etc/courier/userdb SYNOPSIS
userdb {addr} set {field=value...} userdb {addr} unset {field...} userdb {addr} del userdb {path/addr} [set | unset | del] ... userdb -f {file} {adr} [set | unset | del] ... userdb -show {path} userdb -show {path} {addr} userdb -show -f {file} userdb -show -f {file} {addr} DESCRIPTION
userdb is a convenient script to individually manipulate entries in /etc/courier/userdb. See makeuserdb(8)[1] for a description of its contents. /etc/courier/userdb can always be edited using any text editor, but userdb is a convenient way to modify this file from another script. /etc/courier/userdb can also be a subdirectory, instead of a file. Specify foo/bar/addr to manipulate addr in the file /etc/courier/userdb/foo/bar. You can also use the -f flag: -f /etc/courier/userdb/foo/bar is equivalent. Use whatever form makes the most sense to you. /etc/courier/userdb must not have any group or world permissions. That's because its contents may include system passwords (depending upon the application which uses this virtual user account database). Each line in /etc/courier/userdb takes following form: addr specifies a unique virtual address. It is followed by a single tab character, then a list of field=value pairs, separated by vertical slash characters. See makeuserdb(8)[1] for field definitions. A text editor can be used to add blank lines or comments in /etc/courier/userdb. Any blank lines or comments are ignored by the userdb script. The names of the actual fields, and their contents, are defined entirely by applications that use the /etc/courier/userdb database, the userdb command just adds or removes arbitrary fields. For example: userdb default/info set mail=/home/mail/info This command accesses the address "info" in /etc/courier/userdb/default. If the second argument to userdb is "set", the remaining arguments are taken as field=value pairs, which are added to the record for addr. If there is no record for addr, a new record will be appended to the file. If addr exists, any existing values of any specified fields are removed. If =value is missing, userdb stops and prompts for it. This is useful if you're setting a password field, where you do not want to specify the password on the command line, which can be seen by the ps(1) command. If userdb is being executed by a script, the value can be provided on standard input. Use "unset" to delete fields from an existing record. Use "del" to delete all fields in the existing record, plus the record itself. DISPLAYING /etc/courier/userdb If the first argument to userdb is -show, userdb displays the contents of /etc/courier/userdb. If /etc/courier/userdb is a subdirectory, path must refer to a specific file in /etc/courier/userdb. The -f option can be used instead of path in order to specify an arbitrary file. If addr is not specified, userdb produces a list, on standard output, containing all addresses found in the file, on per line. If addr is specified, userdb produces a list, on standard output, of all the fields in /etc/courier/userdb for this addr. REBUILDING /etc/courier/userdb.dat The actual virtual account/address database is /etc/courier/userdb.dat. This is a binary database file. /etc/courier/userdb is the plain text version. After running userdb, execute the makeuserdb(8)[1] command to rebuild /etc/courier/userdb.dat for the changes to take effect. BUGS
addr must be unique. If /etc/courier/userdb is a subdirectory, it's possible to create the same addr in different files in the subdirectory. This is an error that is not currently detected by userdb, however the subsequent makeuserdb(8)[1] command will fail with an error message. FILES
/etc/courier/userdb - plain text file, or directory of plain text files .lock.filename - lock file for filename .tmp.filename - temporary file used to create new contents of filename SEE ALSO
makeuserdb(8)[1], userdbpw(8)[2] NOTES
1. makeuserdb(8) makeuserdb.html 2. userdbpw(8) userdbpw.html Double Precision, Inc. 08/23/2008 USERDB(8)
All times are GMT -4. The time now is 09:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy