#!/bin/bash logroot="/usr/servers/nginx/logs" hisroot=$logroot/log-history sudo mkdir -p $hisroot day=$(date '+%Y%m%d') aclogname="${day}-access.log" erlogname="${day}-error.log" cat $logroot/api-access.log > $hisroot/$aclogname cat $logroot/api-error.log > $hisroot/$erlogname sudo truncate -s 0 $logroot/api-access.log sudo truncate -s 0 $logroot/api-error.log
|