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

s3cmd - Preserve doesn't add metadata to directories #1339

Open
Chris-Leeworthy opened this issue Sep 20, 2023 · 3 comments
Open

s3cmd - Preserve doesn't add metadata to directories #1339

Chris-Leeworthy opened this issue Sep 20, 2023 · 3 comments

Comments

@Chris-Leeworthy
Copy link

I'm currently using s3cmd sync to backup a small linux filesystem to s3.

I noticed that, when recovering files from the bucket the files have the right ownerships and permissions but the directories/folders that contain them do not.

Looking at object metadata in S3 it seems that files have the ownership and permissions metadata but the folders do not.

When I do a recovery I find the files have the right permissions and ownership but they can't be accessed because the containing folders do not.

Ideally I would want sync with --preserve to store metadata for directories as well as the files themselves.

Can this data be stored for folder objects as well as file objects?

@fviard
Copy link
Contributor

fviard commented Nov 3, 2023

Normally, the concept of "folder" does not exist in S3. Only files and the path to them are stored.
This is why empty folders are not saved also.

But there is a new feature in s3cmd that is currently only in MASTER until the next version is released:
When you do a local to remote "sync", if you use the "--keep-dirs" option, "folders" will be also saved in s3 with their permissions.
And so, when you do a remote to local sync, folders should be restored with the correct permissions.

For more details on how it works, we use kind of "empty files" on the S3 side to keep as a kind of "fake folder". This is almost what would do the web interface of aws s3 when you manually create a folder.

It would be highly appreciated if you could give it a try.

@fviard
Copy link
Contributor

fviard commented Dec 13, 2023

@Chris-Leeworthy Would it be possible for you to give a try to the v2.4.0 version with the "-k" flag (in addition with the preserve), to see if your issue is resolved?

@Chris-Leeworthy
Copy link
Author

Thanks @fviard I will give it a try when I'm back at work on Monday and let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants