Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log retention of curve cluster service #336

Closed
wants to merge 5 commits into from
Closed

Log retention of curve cluster service #336

wants to merge 5 commits into from

Conversation

hdbdn77
Copy link

@hdbdn77 hdbdn77 commented Nov 10, 2023

fix #197
Must be executed on the working node

Must be executed on the working node

Signed-off-by: Liao PengFei <[email protected]>
Signed-off-by: Liao PengFei <[email protected]>

# Check if the file exists
if [ ! -f "$json_file" ]; then
die "json file ${json_file} does not exist.\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is ok? die and success function seems to require two parameter.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果你调用 die 函数时只提供了一个参数,那么 ${2} 就是空的。

# Check whether interval is greater than or equal to 0
if [[ ! ($interval =~ ^[0-9]+$) ]]; then
die "The interval parameter is invalid.\n"
elif [[ ! ($interval -ge 0) ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to convert into integer and then determine?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个代码片段检查变量 $interval 是否为非负整数。
在数值比较中,Shell 会尝试将字符串转换为数字,如果无法转换则会置零。

# Check if compress_or_clean is equal to 0 or equal to 1
if [[ ! ($compress_or_clean =~ ^[0-9]+$) ]]; then
die "The compress_or_clean parameter is invalid.\n"
elif [[ ! ($compress_or_clean -eq 0 || $compress_or_clean -eq 1) ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

# Check if max_tar_file is greater than or equal to 1
if [[ ! ($max_tar_file =~ ^[0-9]+$) ]]; then
die "The max_tar_file parameter is invalid.\n"
elif [[ ! ($max_tar_file -ge 1) ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

@hdbdn77 hdbdn77 closed this by deleting the head repository Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[develop activities] please rotate service log
2 participants