Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trace_12.03.05_17.11.20.log
- trace_12.03.05_17.12.30.log
- trace_12.03.05_17.13.45.log
- trace_12.03.05_17.13.23.log
- trace_12.03.05_17.14.40.log
- # Logrotate file for trace
- /source/path/trace_*.log {
- missingok
- create
- compress
- rotate 1
- lastaction
- # After compressing logs, move to other location
- Log_dir="/target/dir/old_log_$(date +%F)/$(date +%H_%S)/"
- [[ ! -d "${Log_dir}" ]] && /bin/mkdir -p "${Log_dir}"
- /bin/mv /source/path/*.gz "${Log_dir}"
- endscript
- }
- 00 * * * * /usr/sbin/logrotate -f /etc/logrotate_trace.conf
- /usr/sbin/logrotate -f /etc/logrotate_trace.conf
- cp -p --update /source/path/trace_*.log /target/dir
- rsync -a /path/to/source/*.log /path/to/backup/directory/
Add Comment
Please, Sign In to add comment