rsync and logrotate transfers old logs every day

懵懂的女人 提交于 2019-12-10 18:44:02

问题


I have Apache web server producing considerable amount of log files. I do logrotate them every day on the server. Every night I rsync server backups over Internet to another computer.

The speedup of log files sync is very close to 1, because logrotate renames all the files and rsync treat them as totally different, because they really are.

I guess this is common problem, what tools would you recommend me to use. I want to keep some history of logs (like 50 days) on the server and whole log history on backup. The night job should only transfer logs from last day.


回答1:


Use the dateext option in logrotate:

Archive old versions of log files adding a daily extension like YYYYMMDD instead of simply adding a number.



来源:https://stackoverflow.com/questions/28800977/rsync-and-logrotate-transfers-old-logs-every-day

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!