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

Unsafe practices when deleting directories #295

Open
SeanBryan51 opened this issue May 16, 2024 · 0 comments
Open

Unsafe practices when deleting directories #295

SeanBryan51 opened this issue May 16, 2024 · 0 comments

Comments

@SeanBryan51
Copy link
Collaborator

We should ensure that STATE_DIR is actually set. Some systems may treat a blank as valid, then the next command will attempt to wipe the root.

I agree but I'm not sure how to address this. STATE_DIR is a constant pathlib.Path object and is not possible for the object to be 'unset' (by default Path() evaluates to the current working directory). Although we are thinking of making these constants configurable in the future (see #151) which would require addressing this issue. The underlying issue might be due to the approach we are taking when doing clean up. A safer way could be to archive run directories instead of deleting them recursively, and have an explicit command to do the deletion of the archive directory. This is similar to how payu sweep works. This way the deletion would not depend on a variable which could be misconfigured.

Originally posted by @SeanBryan51 in #291 (comment)

@SeanBryan51 SeanBryan51 changed the title Deleting directories is unsafe Unsafe practices when deleting directories May 16, 2024
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

No branches or pull requests

1 participant