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

Upload directory to s3 is incorrect if destination directory exists #64

Open
Kirill888 opened this issue Oct 8, 2019 · 0 comments
Open

Comments

@Kirill888
Copy link
Member

This is for branch network-fs-support-newbase, but just to keep track.

When moving temp data from /some/temp_dir/* to s3://bucket/final/destination/ we expect that files from /some/temp_dir/ are copied to s3, but the directory itself is not copied to s3.

https://github.com/GeoscienceAustralia/eo-datasets/blob/075c0e787bc8809d9831afb917de4d4acad7091d/eodatasets3/utils.py#L177

Behaviour of the line above differs depending on whether destination folder exists, at least for s3, but probably for fs as well.

Expected behaviour is equivalent to:

  • mkdir -p $FINAL_DIR && cp -r $TMP_DIR/* $FINAL_DIR/

Actual behaviour when $FINAL_DIR exists is:

  • cp $TMP_DIR $FINAL_DIR/

which creates extra directory layer under $FINAL_DIR

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