|

楼主 |
发表于 2004-10-13 13:01:58
|
显示全部楼层
搞定了,光靠查询论坛的帖子就解决了,看来以后要多看看这里的帖子了
1. filecheckpre.sh
ls /home/backup-group/file > /root/backupcheck
2. filecheck.sh
ls /home/backup-group/file > /root/backupchecktmp
if diff /root/backupcheck /root/backupchecktmp >/dev/null;
then echo Files in /home/backup-group/file is the same as before;
else echo "Content: Files in /home/backup-group/file has been changed. " | mail root@localhost -s "Title: Files is changed!";
echo Files in /home/backup-gruop/file has been changed;
fi
首先运行第一个帖子,为的是保存原有的文件列表
然后,当要查看/home/backup-group/file中的文件有没有改变的时候(文件名的改变,或者增加、减少了文件),如果有改变就发送mail到root@localhost |
|