可以使用该命令删除过期的备份及过期的日志等等。
find /home/www/backup -type f -mtime +7 -exec rm -f {} \;
说明:/home/www/backup是find查找备份文件的路径。
-type f是指定文件类型为普通文件。
-mtime +7是指7天之前的文件。
-exec rm -f指执行静默删除匹配出来的文件。
可将其加到自动任务里面,这样就可以做到自动清除了。
ppt.cc/fVjECx ppt.cc/fEnHsx ppt.cc/fRZTnx ppt.cc/fSZ3cx ppt.cc/fLOuCx ppt.cc/fE9Nux ppt.cc/fL5Kyx ppt.cc/fIr1ax ppt.cc/f71Yqx tecmint.com linuxcool.com linux.die.net linux.it.net.cn ostechnix.com unix.com ubuntugeek.com runoob.com man.linuxde.net ppt.cc/fwpCex ppt.cc/fxcLIx ppt.cc/foX6Ux linuxprobe.com linuxtechi.com howtoforge.com linuxstory.org systutorials.com ghacks.net linuxopsys.com ppt.cc/ffAGfx ppt.cc/fJbezx ppt.cc/fNIQDx ppt.cc/fCSllx ppt.cc/fybDVx ppt.cc/fIMQxx ppt.cc/fKlBax
find /home/www/backup -type f -mtime +7 -exec rm -f {} \;