1.日志删除策略
自动删除7天前的归档日志与备份文件。
2.调度计划
0 0 * * * nohup sh /db2backup/script/auto_rm_logs.sh &
3.日志删除脚本
auto_rm_logs.sh #!/bin/sh #------------------------------------- # rm db2 archive log file and *.tgz files @hury # create @2016-12-13 # script name:auto_rm_logs.sh # 1.chmod 744 auto_rm_logs.sh # 2.crontab -e # for test only # */2 * * * * nohup sh /db2backup/script/auto_rm_logs.sh & # for official # 0 0 * * * nohup sh /db2backup/script/auto_rm_logs.sh & #------------------------------------ #params archlog_path=/db2backup/archlog backup_path=/db2backup/backup find $archlog_path -mtime +7 -name "s*.log" |xargs rm -f find $backup_path -mtime +7 -name "*.tgz" |xargs rm -f
如对本文有疑问, 点击进行留言回复!!
No.175-HackTheBox-Linux-Wall-Walkthrough渗透学习
【linux系统编程学习笔记】第十三节:线程的安全机制3(条件变量)(pthread_cond_wait、pthread_cond_signal、pthread_cond_broadcast)
网友评论