Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
liyapeng
/
log_collect
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 18ebc364
authored
Oct 13, 2023
by
liyapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceshi
1 parent
739b9d48
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
.cos.yaml
log_collect.sh
.cos.yaml
0 → 100644
View file @
18ebc36
cos
:
base
:
secretid
:
3kNZR4wfjUgOqbHffiQSMw==
secretkey
:
3kNZR4wfjUgOqbHffiQSMw==
sessiontoken
:
3kNZR4wfjUgOqbHffiQSMw==
protocol
:
https
mode
:
"
"
cvmrolename
:
"
"
buckets
:
-
name
:
"
"
alias
:
"
"
region
:
"
"
endpoint
:
"
"
ofs
:
false
log_collect.sh
View file @
18ebc36
...
...
@@ -22,8 +22,6 @@ space=$(df -hm / | tail -n 1 | awk '{print $(NF-2) }')
echo
-e
"
\0
33[41;33m This script is used as a daily troubleshooting and does not involve collecting relevant privacy data
\0
33[0m"
main
systemlog
()
{
#收集操作系统产生的日志
mkdir -p
${
LOG_FILE_PATH
}
/systemlog
...
...
@@ -98,7 +96,7 @@ Bundlinglogfiles() {
uploadlogfile
()
{
echo
"upload log file"
chmod +x coscli
./coscli -e
${
ENDPOINT
}
-i
${
TMP_SECRET_ID
}
-k
${
TMP_SECRET_KEY
}
--token
${
TMP_SESSION_TOKEN
}
cp /tmp/
${
LOG_DIR
}
.tar cos://
${
BUCKET_NAME
}
/
${
LOG_DIR
}
.tar
./coscli -
c ./.cos.yaml -
e
${
ENDPOINT
}
-i
${
TMP_SECRET_ID
}
-k
${
TMP_SECRET_KEY
}
--token
${
TMP_SESSION_TOKEN
}
cp /tmp/
${
LOG_DIR
}
.tar cos://
${
BUCKET_NAME
}
/
${
LOG_DIR
}
.tar
}
main
()
{
...
...
@@ -111,3 +109,5 @@ main() {
uploadlogfile
rm -r
${
LOG_FILE_PATH
}
}
main
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment