[CentOS] help with script

Mon Nov 5 17:36:31 UTC 2007
Les Mikesell <lesmikesell at gmail.com>

Mark Snyder wrote:
> 
>>> I am doing a md5sum to verify nightly transfer of files between 
>>> servers and want to email the results to support.

1st suggestion: use rsync to transfer the files and you don't have to 
double-check the results, just the exit status of the command or its 
stderr output.  It will know whether the tranfer worked or not.


>>
>> Is this a cronjob?  If so, then don't bother using 'mail'; just echo 
>> to stdout
>> and let cron handle the mailing.

> 
> Yes you are right about setting a variable, but this was supposed to be 
> a quick and dirty.

Quick and dirty things don't write files and have to worry about 
filenames.  See if you can do it all through pipes if you do this at all.

> I will want it to be a cronjob when its working, how can I get it to 
> mail the output of the diff? and not just the stdout of the cronjob?  
> The whole point of this is the get the output of the diff to someone.

It's your script, make it say what you want (and nothing else) on stdout.

-- 
   Les Mikesell
    lesmikesell at gmail.com