Copying Files from Ec2 to S3

0

I am copying files from the ec2 server(Ubuntu) to s3 using the command- aws s3 sync --no-guess-mime-type "/opt/mydir/" "s3://copy-test". Files are getting copied but the permissions are not getting preserved like root gets changed to user when I fetch these files to another ec2 instance. Am I missing something or the permissions can't be preserved if I use the CLI commands?

Thanks.

shyam
質問済み 9ヶ月前393ビュー
2回答
1

The other answer is correct (S3 isn't a Linux filesystem) and the AWS-supplied CLI won't do what you want - but there is a twist here.

Metadata can be stored with objects in S3. That metadata could include (say) the original file owner and then that could be restored when the object is copied back from S3. This requires the tool doing the copying to take care of that for you.

You might look at s3cmd as an example but there are probably others out there too.

profile pictureAWS
エキスパート
回答済み 9ヶ月前
profile picture
エキスパート
Steve_M
レビュー済み 9ヶ月前
  • Thanks for the reply

0

S3 doesn't store "Linux" permissions for object. Consider using EFS instead. See some discussion on this topic under: https://www.reddit.com/r/aws/comments/d8lw4z/how_to_preserve_file_permissions_on_a_file_when/

回答済み 9ヶ月前
  • Thanks for the reply

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ