Feature #1996 » cutlog.sh
1 |
#!/bin/bash
|
---|---|
2 |
log_pathone=/var/log/nginx/access.log |
3 |
log_pathtwo=/var/log/nginx/error.log |
4 |
save_pathone=/var/log/nginx/access_$(date +%Y%m%d -d 'yesterday').log |
5 |
save_pathtwo=/var/log/nginx/error_$(date +%Y%m%d -d 'yesterday').log |
6 |
cp $log_pathone $save_pathone && echo > $log_pathone |
7 |
cp $log_pathtwo $save_pathtwo && echo > $log_pathtwo |