初始提交

This commit is contained in:
wanyongkang
2020-10-07 20:25:03 +08:00
commit d318014316
3809 changed files with 263103 additions and 0 deletions

13
script/.editorconfig Normal file
View File

@@ -0,0 +1,13 @@
# editorconfig.org
root = true
[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

35
script/clearpsiplog.js Normal file
View File

@@ -0,0 +1,35 @@
#! /usr/bin/node
const fs = require('fs');
const dayjs = require('dayjs');
const shell = require('shelljs');
const is_numeric = (value) => {
if (typeof (value) === 'object') {
return false;
} else {
return !Number.isNaN(Number(value));
}
};
const startPath = "/data/docker/applog/psip";
fs.readdirSync(startPath).forEach(item => {
fs.readdirSync(`${startPath}/${item}/Logs`).forEach(logDir => {
if (is_numeric(logDir)) {
var date = dayjs(logDir.toString());
if (date.isBefore(dayjs().subtract(7, 'day'))) {
const deleteDir = `${startPath}/${item}/Logs/${logDir}`;
shell.exec(`rm -rf ${deleteDir}`);
console.log(`删除文件夹${deleteDir}`);
}
}
})
});

10
script/package.json Normal file
View File

@@ -0,0 +1,10 @@
{
"name": "script",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"dayjs": "^1.8.15",
"shelljs": "^0.8.3"
}
}