Sponsored Content
Full Discussion: Simple Email Script
Top Forums Shell Programming and Scripting Simple Email Script Post 302780709 by kirfee on Friday 15th of March 2013 02:54:47 AM
Old 03-15-2013
You can try with the following bash script but make sure you test it. There will be many more smart ways to do it.
Code:
#!/bin/bash
NOW=$(date +"%Y-%m-%e")
if ls *$NOW*
then
echo 'BACKUP DONE ' | mail -s backupreport ithelpdesk@enovatemedia.co.in
else 'file not found' | mail -s backupreport ithelpdesk@enovatemedia.co.in
fi


Last edited by Franklin52; 03-17-2013 at 05:59 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

simple script

guys, I have a need for a simple script that scans all of our users home directories (/home/*) and looks to see if the executable bit is on. If it finds that a user has a file with an executable bit on, it will send an email to managment. (no users are supposed to have any programs of their own... (4 Replies)
Discussion started by: hedrict
4 Replies

2. Shell Programming and Scripting

Need a simple script

I have just recently decided to install Unix on one of my home computers, and I am enjoying it so far. However, I have no knowledge of writing computer programs or scripts. What I need to accomplish is a way for me to create backup copies of certain files, but I want to be able to just type all of... (10 Replies)
Discussion started by: Relykk
10 Replies

3. Shell Programming and Scripting

simple script help

TZ=`date +%Z`+24 ; a=`date +%Y-%m-%d`-----------greps 1 day ago date........ but this command greps date in files for 1 day ago date........even the current date is found inside the file..... is there any logic using this command that it will grep the last date entry made in file ,whether it... (4 Replies)
Discussion started by: ali560045
4 Replies

4. Shell Programming and Scripting

simple script

Experts, i've made a script in PHP. I'm looking for a script wat does the same but for Unix. Is there anyone who can make this for me (for free). I understand that normally you will only help and not make complete scripts but... With kindly regards Klaasjan Boven <?php // datum... (2 Replies)
Discussion started by: klaasjan
2 Replies

5. Shell Programming and Scripting

help in my simple script

Hi friends I have a file with two colums separated by Tab, the second colum had some numbers like the following: koko 2 toto3 4 momo6 1 hoho 0 bobo5 3 I'm trying to make a script that give me the results for rows when the second colum value are greater than 1 I make the... (7 Replies)
Discussion started by: reaky
7 Replies

6. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

7. Shell Programming and Scripting

Simple Script Can u help please?

I have a file that contains these lines User ID Username -------- ---------- 7738626,zrazak 7783535,jvincigu 7805567,ldrennan 7805583,mtsakama I need to sort the names alphabetically How can I sort the lines based on the user names ? I would appreciate a quick reply anyone ... (1 Reply)
Discussion started by: mnassiri
1 Replies

8. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

9. UNIX Desktop Questions & Answers

Need help with simple script

I work for a small internet company, and sometimes its useful to ping a certain IP over an open amount of time. I wrote a simple script that asks what IP you'd like to ping, and then pings it and puts it into a text file so that you can save the results. What i'd like though, is to have an infinite... (1 Reply)
Discussion started by: LelandSelene
1 Replies

10. Linux

How to execute a simple select script using a shell script?

Hi team, I have two select statements and need to run them using SYSDBA user select * from temp_temp_seg_usage; select segment_name, tablespace_name, bytes/ (1024*1024) UsedMb from dba_segments where segment_name='TEMP_TEMP_SEG_USAGE'; Need to run this using a shell script say named... (1 Reply)
Discussion started by: pamsy78
1 Replies
Email::Sender(3pm)					User Contributed Perl Documentation					Email::Sender(3pm)

NAME
Email::Sender - a library for sending email VERSION
version 0.110005 SYNOPSIS
my $message = Email::MIME->create( ... ); # produce an Email::Abstract compatible message object, # e.g. produced by Email::Simple, Email::MIME, Email::Stuff use Email::Sender::Simple qw(sendmail); use Email::Sender::Transport::SMTP qw(); use Try::Tiny; try { sendmail( $message, { from => $SMTP_ENVELOPE_FROM_ADDRESS, transport => Email::Sender::Transport::SMTP->new({ host => $SMTP_HOSTNAME, port => $SMTP_PORT, }) } ); } catch { warn "sending failed: $_"; }; OVERVIEW
Email::Sender replaces the old and sometimes problematic Email::Send library, which did a decent job at handling very simple email sending tasks, but was not suitable for serious use, for a variety of reasons. Most users will be able to use Email::Sender::Simple to send mail. Users with more specific needs should look at the available Email::Sender::Transport classes. Documentation may be found in Email::Sender::Manual, and new users should start with Email::Sender::Manual::QuickStart. IMPLEMENTING
Email::Sender itelf is a Moose role. Any class that implements Email::Sender is required to provide a method called "send". This method should accept any input that can be understood by Email::Abstract, followed by a hashref containing "to" and "from" arguments to be used as the envelope. The method should return an Email::Sender::Success object on success or throw an Email::Sender::Failure on failure. AUTHOR
Ricardo Signes <rjbs@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Ricardo Signes. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-03-06 Email::Sender(3pm)
All times are GMT -4. The time now is 04:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy