以下脚本会自动发送邮件提醒进行备份,shell/ target=_blank class=infotextkey>shell脚本如下:
#!/bin/ksh
# *****************************
# * linux下的自动提醒备份
# * 需要使用:mailX 与 crontab
# *****************************
MAIL_LIST=/usr/users/vijay/addr_list
CC_LIST=/usr/users/vijay/cc_list
USER1_HOME=/usr/users/ragavk
USER2_HOME=/usr/users/vijay
USER3_HOME=/usr/users/venkat
SUBJECT="HP OV TeMIP - Backup Remainder"
TO=`cat $MAIL_LIST`
/usr/bin/mailx -s "${SUBJECT}" ${TO} <<-EOF
~< !date
Hi,
Please take backup all the date from the location given below.
Project Name : HP OV TeMIP
System Name : hpmdd13
Path :
`cat $USER1_HOME/backup_data 2>/dev/null` #Content of the File will be inserted here#
`cat $USER2_HOME/backup_data 2>/dev/null`
`cat $USER3_HOME/backup_data 2>/dev/null`
有任何问题,请致电:xxxxxx
这是一封系统自动提醒邮件,请勿回复。
Best Regards,
www.jb200.com
~c < `cat $CC_LIST`
EOF
echo "Done"