Shell腳本實現(xiàn)檢測文件是否被修改過代碼分享
更新時間:2014年09月17日 08:48:06 投稿:junjie
這篇文章主要介紹了Shell腳本實現(xiàn)的檢測文件是否被修改代碼分享,其實了解了原理就可以做很多事了,需要的朋友可以參考下
#!/bin/bash
funmd5_1() {
find /root/passwd -type f | xargs md5sum > /tmp/funmd5_1.log
}
funmd5_2() {
find /root/passwd -type f | xargs md5sum > /tmp/funmd5_2.log
}
if [ ! -f /tmp/funmd5_1.log ];then
funmd5_1
fi
funmd5_2
diff /tmp/funmd5_1.log /tmp/funmd5_2.log > /tmp/diff.log
Status=$?
if [ $Status = 0 ];then
exit
else
echo "文件修改過了!"
fi
您可能感興趣的文章:
相關文章
shell for循環(huán)、循環(huán)變量值付給其他shell腳本的方法
今天小編就為大家分享一篇shell for循環(huán)、循環(huán)變量值付給其他shell腳本的方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-06-06
linux shell txt轉換成html的實現(xiàn)代碼
這篇文章主要介紹了linux shell txt轉換成html的實現(xiàn)代碼,需要的朋友可以參考下2016-11-11

