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

[curve/toos-v2]: add clean-recycle #2349

Closed
Cyber-SiKu opened this issue Mar 30, 2023 · 3 comments
Closed

[curve/toos-v2]: add clean-recycle #2349

Cyber-SiKu opened this issue Mar 30, 2023 · 3 comments
Labels
enhancement improve feature good first issue Good for newcomers

Comments

@Cyber-SiKu
Copy link
Contributor

Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)

we'd like to support bs delete recycle command in curve tool

  • The implementation of the old tool is here:
    } else if (cmd == kCleanRecycleCmd) {
    uint64_t expireTime;
    if (!::curve::common::StringToTime(FLAGS_expireTime, &expireTime)) {
    std::cout << "Clean recyclebin: invalid expireTime!" << std::endl;
    return 0;
    }
    auto dirname = fileName.empty() ? "/" : fileName;
    if (FLAGS_isTest) {
    return core_->CleanRecycleBin(dirname, expireTime);
    }
    std::cout << "Are you sure you want to clean the RecycleBin, "
    << "the file in the directory " << dirname
    << " will be deleted forever (yes/no)" << std::endl;
    std::string str;
    std::cin >> str;
    if (str == "yes") {
    return core_->CleanRecycleBin(dirname, expireTime);
    } else {
    std::cout << "Clean RecycleBin cancled!" << std::endl;
    return 0;
    }
  • The old command input and out put:
curve_ops_tool clean-recycle -fileName=/cinder

-------
output:
Space info:
Are you sure you want to clean the RecycleBin, the file in the directory /cinder will be deleted forever (yes/no)
yes
CleanRecycleBin success!

Refer to tool develop guide to get start, and paste the result of the command in pr.

Build compilation environment:https://github.com/opencurve/curve/blob/master/docs/cn/build_and_run.md

Describe the solution you'd like (描述你期望的解决方法)

Add subcommand clinet to curve bs list.

Describe alternatives you've considered (描述你想到的折衷方案)

Additional context/screenshots (更多上下文/截图)

@zhanghuidinah
Copy link
Member

@baytan0720
Copy link
Member

I want to try, could you assign it to me?

@Cyber-SiKu
Copy link
Contributor Author

I want to try, could you assign it to me?

Sorry, I have repeated this topic, someone else has already done it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improve feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants