-
Notifications
You must be signed in to change notification settings - Fork 72
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
Conversation
Must be executed on the working node Signed-off-by: Liao PengFei <[email protected]>
Signed-off-by: Liao PengFei <[email protected]>
Signed-off-by: Liao PengFei <[email protected]>
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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
fix #197
Must be executed on the working node