[root@ceph-node1 shell-100]# crontab -l
06 21 * * * tar czf /var/www/html/log.tar.gz /var/log
#02 21 * * * free -m
42 17 * * 5 sh /opt/shell/shell-100/logbak.sh
[root@ceph-node1 shell-100]# nl logbak.sh
1 #!/bin/bash
2 #tar -czf `date +%Y_%m_%d`.tar.gz /var/log #用如下的格式
3 tar -czf /opt/shell/shell-100/$(date +%Y_%m_%d).tar.gz /var/log
[root@ceph-node1 shell-100]#
日志备份
最新推荐文章于 2022-06-20 07:27:11 发布