AWS S3 downloaded files have “last modified date” of the file in S3 after download












0














I'm using AWS CLI to download some files from S3 (command: 'aws s3 sync'). The problem I have is, that the downloaded file has the same "last modified" date as the file in S3. What I want is that the "last modified" date of my downloaded file is set to the time it was downloaded (It was created at that moment, so it was modified the last time at that moment).



If this is not possible, is there a way to change the output of the sync command? What I need is a list of absolute paths of all files downloaded by the sync command. At the moment I want to list these files by the "last modified" date using the "find" command of linux, but just using the sync commands output would be better I think.










share|improve this question





























    0














    I'm using AWS CLI to download some files from S3 (command: 'aws s3 sync'). The problem I have is, that the downloaded file has the same "last modified" date as the file in S3. What I want is that the "last modified" date of my downloaded file is set to the time it was downloaded (It was created at that moment, so it was modified the last time at that moment).



    If this is not possible, is there a way to change the output of the sync command? What I need is a list of absolute paths of all files downloaded by the sync command. At the moment I want to list these files by the "last modified" date using the "find" command of linux, but just using the sync commands output would be better I think.










    share|improve this question



























      0












      0








      0







      I'm using AWS CLI to download some files from S3 (command: 'aws s3 sync'). The problem I have is, that the downloaded file has the same "last modified" date as the file in S3. What I want is that the "last modified" date of my downloaded file is set to the time it was downloaded (It was created at that moment, so it was modified the last time at that moment).



      If this is not possible, is there a way to change the output of the sync command? What I need is a list of absolute paths of all files downloaded by the sync command. At the moment I want to list these files by the "last modified" date using the "find" command of linux, but just using the sync commands output would be better I think.










      share|improve this question















      I'm using AWS CLI to download some files from S3 (command: 'aws s3 sync'). The problem I have is, that the downloaded file has the same "last modified" date as the file in S3. What I want is that the "last modified" date of my downloaded file is set to the time it was downloaded (It was created at that moment, so it was modified the last time at that moment).



      If this is not possible, is there a way to change the output of the sync command? What I need is a list of absolute paths of all files downloaded by the sync command. At the moment I want to list these files by the "last modified" date using the "find" command of linux, but just using the sync commands output would be better I think.







      sync amazon-web-services amazon-s3 date-modified






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 10 at 8:09

























      asked Jun 10 at 0:59









      ChampS

      1869




      1869






















          2 Answers
          2






          active

          oldest

          votes


















          0














          it's a bit of a hack but maybe you could try using the touch command to update the last modified date of all the files you sync from s3?






          share|improve this answer





















          • my intention is to get all files which were downloaded during the sync command. To touch them I need to know them and if I know which files were synced, there is no need for touch anymore.
            – ChampS
            Jul 20 at 8:39





















          0














          there is an exact match.
          If you add this to the end of your command, it should help.
          --exact-timestamp



          Then it should check the file size and timestamp. If both of these are the same, I am not sure what you can do.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1330006%2faws-s3-downloaded-files-have-last-modified-date-of-the-file-in-s3-after-downlo%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            it's a bit of a hack but maybe you could try using the touch command to update the last modified date of all the files you sync from s3?






            share|improve this answer





















            • my intention is to get all files which were downloaded during the sync command. To touch them I need to know them and if I know which files were synced, there is no need for touch anymore.
              – ChampS
              Jul 20 at 8:39


















            0














            it's a bit of a hack but maybe you could try using the touch command to update the last modified date of all the files you sync from s3?






            share|improve this answer





















            • my intention is to get all files which were downloaded during the sync command. To touch them I need to know them and if I know which files were synced, there is no need for touch anymore.
              – ChampS
              Jul 20 at 8:39
















            0












            0








            0






            it's a bit of a hack but maybe you could try using the touch command to update the last modified date of all the files you sync from s3?






            share|improve this answer












            it's a bit of a hack but maybe you could try using the touch command to update the last modified date of all the files you sync from s3?







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jul 19 at 15:07









            ryc010

            1




            1












            • my intention is to get all files which were downloaded during the sync command. To touch them I need to know them and if I know which files were synced, there is no need for touch anymore.
              – ChampS
              Jul 20 at 8:39




















            • my intention is to get all files which were downloaded during the sync command. To touch them I need to know them and if I know which files were synced, there is no need for touch anymore.
              – ChampS
              Jul 20 at 8:39


















            my intention is to get all files which were downloaded during the sync command. To touch them I need to know them and if I know which files were synced, there is no need for touch anymore.
            – ChampS
            Jul 20 at 8:39






            my intention is to get all files which were downloaded during the sync command. To touch them I need to know them and if I know which files were synced, there is no need for touch anymore.
            – ChampS
            Jul 20 at 8:39















            0














            there is an exact match.
            If you add this to the end of your command, it should help.
            --exact-timestamp



            Then it should check the file size and timestamp. If both of these are the same, I am not sure what you can do.






            share|improve this answer


























              0














              there is an exact match.
              If you add this to the end of your command, it should help.
              --exact-timestamp



              Then it should check the file size and timestamp. If both of these are the same, I am not sure what you can do.






              share|improve this answer
























                0












                0








                0






                there is an exact match.
                If you add this to the end of your command, it should help.
                --exact-timestamp



                Then it should check the file size and timestamp. If both of these are the same, I am not sure what you can do.






                share|improve this answer












                there is an exact match.
                If you add this to the end of your command, it should help.
                --exact-timestamp



                Then it should check the file size and timestamp. If both of these are the same, I am not sure what you can do.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 4 at 22:47









                azz

                1




                1






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1330006%2faws-s3-downloaded-files-have-last-modified-date-of-the-file-in-s3-after-downlo%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Сан-Квентин

                    Алькесар

                    Josef Freinademetz