Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


sending_email

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
sending_email [2020/04/20 17:42] – created juckinssending_email [2020/04/20 17:43] juckins
Line 1: Line 1:
 ==== Sending email ==== ==== Sending email ====
  
-  `echo '$now\n\nLast saved file: $latest_file_download' | mailx -s '$script_name.pl reports stale source files' $sysadmin`;+<code> 
 +#!/usr/bin/perl -w
  
 +$sysadmin = "user\@domain.com";
 +$script_name = "test";
 +$archive_data_dir = "/a/b/c"; 
 +$latest_file_download = `ls -1 $archive_data_dir| tail -n 1`;
 +
 +now();
 +`echo '$now\n\nLast saved file: $latest_file_download' | mailx -s '$script_name.pl reports stale source files' $sysadmin`;
 +
 +sub now {
 +  $now = `date`;
 +  chomp($now);
 +}
 +</code>
sending_email.txt · Last modified: 2020/11/12 10:30 by juckins