忽略dll文件git
This commit is contained in:
@@ -1,13 +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
|
||||
# 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
|
||||
|
||||
@@ -1,35 +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}`);
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
#! /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}`);
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "script",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dayjs": "^1.8.15",
|
||||
"shelljs": "^0.8.3"
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "script",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dayjs": "^1.8.15",
|
||||
"shelljs": "^0.8.3"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user