Linux实验楼挑战备份日志

Linux:实验楼挑战备份日志。
$ mkdir tmp
1
2. 启动 rsyslog
$ sudo service rsyslog start
1
3.启动crontab
$ sudo cron -f &
1
4.编辑crontab文件
$ crontab -e
1
/usr/bin/select-editor: 32: /usr/bin/select-editor: gettext: not found
1-3 []: 1 (或者3)
按下a,开始编辑
在文件最后一行输入:

0 3 * * * cp /var/log/alternatives.log /home/shiyanlou/tmp/$(date+ %Y%m%d)
之后按Ctrl + X 保存退出
如果提交有说crontab没有启动那么我们继续执行
$ sudo cron -f &
好了这样就没问题了
!!!如有问题可以评论,我每天都会看看的。

猜你喜欢

转载自blog.csdn.net/weixin_45967696/article/details/106447273