[CentOS] help with script
garrick at usc.edu
Mon Nov 5 17:04:54 UTC 2007
On Mon, Nov 05, 2007 at 09:42:57AM -0600, Mark Snyder alleged:
> Garrick Staples wrote:
> >On Fri, Nov 02, 2007 at 04:39:32PM -0600, Mark Snyder alleged:
> >>I am doing a md5sum to verify nightly transfer of files between servers
> >>and want to email the results to support.
> >>Everything works fine except reading the contents of the check file into
> >>Any suggestions or help would be much appreciated.
> >>cd /bak
> >>md5sum -b `date '+%m-%d-%y'`.tgz > `date '+%m-%d-%y'`.ver
> >>diff -s `date '+%m-%d-%y'`.md5 `date '+%m-%d-%y'`.ver > `date
> >>#outfile=`date '+%m-%d-%y'`.chk #setup name of file to read into
> >>mail -s 'file verify' me at mymailaddr.com <<MAIL_IN
> >>~r `date '+%m-%d-%y'`.chk
> >>entering the same mail commands from a command prompt works.
> >First, stop running `date` over and over. Run it once at the top and set
> >a variable.
> >Second, what is actually going wrong? Is there an error message?
> >Is this a cronjob? If so, then don't bother using 'mail'; just echo to
> >and let cron handle the mailing.
> Yes you are right about setting a variable, but this was supposed to be a
> quick and dirty.
> 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.
Just cat the diff to stdout. Whatever is printed to stdout will be in the email.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://lists.centos.org/pipermail/centos/attachments/20071105/6fb0c76c/attachment.bin
More information about the CentOS