cat << 'eof' > /usr/bin/rmlog
# !/bin/bash
# logrm--Logs all file deletion requests unless the -s flag is used.
removelog="/tmp/remove.log"
if [ $# -eq 0 ] ; then
echo "Usage: $0 [-s] list of files or directories" >&2
exit 1
fi
if [ "$1" = "-s" ] ; then
# silent operation requested ... don't log
shift
else
echo "$(date): ${USER}: $@" >> $removelog
fi
/bin/rm "$@"
exit 0
eof
chmod 755 /usr/bin/rmlog
tuoch /tmp/remove.log
chmod 666 /tmp/remove.logå
linux记录文件删除操作
最新推荐文章于 2023-10-08 17:16:32 发布