1 |
On Mon, Mar 24, 2008 at 2:44 PM, Dirk Heinrichs <dirk.heinrichs@××××××.de> |
2 |
wrote: |
3 |
|
4 |
> Am Montag, 24. März 2008 schrieb Kaushal Shriyan: |
5 |
> |
6 |
> > MAILTO=systems@×××××××.com |
7 |
> > 0 18 * * * /home/kaushal/rsync_mysql.sh |
8 |
> > |
9 |
> > I want my subject line to be "hostxx:yyDB refresh daily" |
10 |
> > |
11 |
> > is there a way to do it |
12 |
> |
13 |
> Don't rely on cron to send the mail, use mailx inside your script instead. |
14 |
> That means, inside the script, capture all output in a temp. file, then |
15 |
> use |
16 |
> |
17 |
> cat /tmp/file|mailx -s "my subject" systems@×××××××.com |
18 |
> |
19 |
> HTH... |
20 |
> |
21 |
> Dirk |
22 |
> |
23 |
|
24 |
Hi Dirk |
25 |
|
26 |
Below is my script |
27 |
############################################################################# |
28 |
|
29 |
#!/bin/bash |
30 |
#rsync mysql database shell script |
31 |
#author kaushal |
32 |
#created on 21/03/2008 |
33 |
|
34 |
TIMESTAMP=`date +%Y-%m-%d-%H:%M:%S:%N` |
35 |
|
36 |
if rsync -av /var/lib/mysql kaushal@host77:/var/lib/ |
37 |
>/tmp/rsync-${TIMESTAMP}.log 2>&1 |
38 |
then |
39 |
echo "Success" |
40 |
else |
41 |
echo "Please check the file rsync-${TIMESTAMP}.log for errors." |
42 |
fi |
43 |
|
44 |
############################################################################# |
45 |
|
46 |
so according to your suggestion where does this line fits "cat |
47 |
/tmp/file|mailx -s "my subject" systems@×××××××.com" <systems@×××××××.com> |
48 |
in my above bash script |
49 |
|
50 |
Thanks and Regards |
51 |
|
52 |
Kaushal |