1
This commit is contained in:
8
cutlog.sh
Normal file
8
cutlog.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
declare logs_path="/opt/upc_resent/log";
|
||||
declare need_delete_path=${logs_path}/$(date -d "7 days ago" "+%Y_%m_%d");
|
||||
declare yestoday_log_path=${logs_path}/$(date -d "yesterday" "+%Y_%m_%d");
|
||||
rm -rf ${need_delete_path}
|
||||
rm -rf ${yestoday_log_path}
|
||||
mv ${logs_path}/today ${yestoday_log_path}
|
||||
mkdir -p ${logs_path}/today
|
||||
Reference in New Issue
Block a user