我试图存档我想要显示的日志文件。但我无法找到问题,为什么它不起作用。需要帮助!
#!/bin/bash
logs="/appl/test/logs"
gzfiles="/appl/test/logs/*.gz"
scripts="/appl/test/scripts"
logsarchive="/appl/test/logs_archive"
find $logs -type f -mtime 0 ! -regex "*.gz" ! -exec /sbin/fuser -s "{}" 2>/dev/null \; -exec gzip {} \; &> $scripts/logcleaner.log
find $logsarchive -type f -mtime +5 -exec rm {} 2>/dev/null \; &>> $scripts/logcleaner.log
mv $gzfiles $logsarchive 2>/dev/null &>> $scripts/logcleaner.log
/ appl / test / logs ucs_access_p.log * - 这些日志未保存。有人有想法吗?