Tar a file from directory based on date











up vote
0
down vote

favorite












How to compress(tar) some files based particular period of date from directory which has containing a lot of files.










share|improve this question






















  • Need example. Is not clean what period you mean.
    – S_Flash
    Nov 21 at 11:13










  • please would you like to tar the whole directory based on the current date or tar individual files based on current date
    – ptetteh227
    Nov 21 at 11:14










  • @ptetteh227 directory itself containing lot of files,so i want to compress one day to next day's files(example 2018-11-19 to 2018-11-20).So mentioning every file is very much difficulty.
    – Jasil Op
    Nov 21 at 11:48










  • There is a folder contains lot files , so i want to compress a particular day's files completely.@S_Flash
    – Jasil Op
    Nov 21 at 12:34










  • @JasilOp Please edit your question to add all the details you posted in comments. It helps to keep our Q&A style tidy and could also bring more attention since an edited question gets bounced on the homepage. See also How do comments work?
    – Melebius
    Nov 21 at 13:26















up vote
0
down vote

favorite












How to compress(tar) some files based particular period of date from directory which has containing a lot of files.










share|improve this question






















  • Need example. Is not clean what period you mean.
    – S_Flash
    Nov 21 at 11:13










  • please would you like to tar the whole directory based on the current date or tar individual files based on current date
    – ptetteh227
    Nov 21 at 11:14










  • @ptetteh227 directory itself containing lot of files,so i want to compress one day to next day's files(example 2018-11-19 to 2018-11-20).So mentioning every file is very much difficulty.
    – Jasil Op
    Nov 21 at 11:48










  • There is a folder contains lot files , so i want to compress a particular day's files completely.@S_Flash
    – Jasil Op
    Nov 21 at 12:34










  • @JasilOp Please edit your question to add all the details you posted in comments. It helps to keep our Q&A style tidy and could also bring more attention since an edited question gets bounced on the homepage. See also How do comments work?
    – Melebius
    Nov 21 at 13:26













up vote
0
down vote

favorite









up vote
0
down vote

favorite











How to compress(tar) some files based particular period of date from directory which has containing a lot of files.










share|improve this question













How to compress(tar) some files based particular period of date from directory which has containing a lot of files.







tar






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 at 10:08









Jasil Op

12




12












  • Need example. Is not clean what period you mean.
    – S_Flash
    Nov 21 at 11:13










  • please would you like to tar the whole directory based on the current date or tar individual files based on current date
    – ptetteh227
    Nov 21 at 11:14










  • @ptetteh227 directory itself containing lot of files,so i want to compress one day to next day's files(example 2018-11-19 to 2018-11-20).So mentioning every file is very much difficulty.
    – Jasil Op
    Nov 21 at 11:48










  • There is a folder contains lot files , so i want to compress a particular day's files completely.@S_Flash
    – Jasil Op
    Nov 21 at 12:34










  • @JasilOp Please edit your question to add all the details you posted in comments. It helps to keep our Q&A style tidy and could also bring more attention since an edited question gets bounced on the homepage. See also How do comments work?
    – Melebius
    Nov 21 at 13:26


















  • Need example. Is not clean what period you mean.
    – S_Flash
    Nov 21 at 11:13










  • please would you like to tar the whole directory based on the current date or tar individual files based on current date
    – ptetteh227
    Nov 21 at 11:14










  • @ptetteh227 directory itself containing lot of files,so i want to compress one day to next day's files(example 2018-11-19 to 2018-11-20).So mentioning every file is very much difficulty.
    – Jasil Op
    Nov 21 at 11:48










  • There is a folder contains lot files , so i want to compress a particular day's files completely.@S_Flash
    – Jasil Op
    Nov 21 at 12:34










  • @JasilOp Please edit your question to add all the details you posted in comments. It helps to keep our Q&A style tidy and could also bring more attention since an edited question gets bounced on the homepage. See also How do comments work?
    – Melebius
    Nov 21 at 13:26
















Need example. Is not clean what period you mean.
– S_Flash
Nov 21 at 11:13




Need example. Is not clean what period you mean.
– S_Flash
Nov 21 at 11:13












please would you like to tar the whole directory based on the current date or tar individual files based on current date
– ptetteh227
Nov 21 at 11:14




please would you like to tar the whole directory based on the current date or tar individual files based on current date
– ptetteh227
Nov 21 at 11:14












@ptetteh227 directory itself containing lot of files,so i want to compress one day to next day's files(example 2018-11-19 to 2018-11-20).So mentioning every file is very much difficulty.
– Jasil Op
Nov 21 at 11:48




@ptetteh227 directory itself containing lot of files,so i want to compress one day to next day's files(example 2018-11-19 to 2018-11-20).So mentioning every file is very much difficulty.
– Jasil Op
Nov 21 at 11:48












There is a folder contains lot files , so i want to compress a particular day's files completely.@S_Flash
– Jasil Op
Nov 21 at 12:34




There is a folder contains lot files , so i want to compress a particular day's files completely.@S_Flash
– Jasil Op
Nov 21 at 12:34












@JasilOp Please edit your question to add all the details you posted in comments. It helps to keep our Q&A style tidy and could also bring more attention since an edited question gets bounced on the homepage. See also How do comments work?
– Melebius
Nov 21 at 13:26




@JasilOp Please edit your question to add all the details you posted in comments. It helps to keep our Q&A style tidy and could also bring more attention since an edited question gets bounced on the homepage. See also How do comments work?
– Melebius
Nov 21 at 13:26










1 Answer
1






active

oldest

votes

















up vote
0
down vote













I would use find then pipe that into tar u.



 find . -type f -newermt 2018-11-20 -not -newermt 2018-11-21 | tar -cvzf filename.tar.gz





share|improve this answer








New contributor




Michael Quale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    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',
    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%2faskubuntu.com%2fquestions%2f1094752%2ftar-a-file-from-directory-based-on-date%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I would use find then pipe that into tar u.



     find . -type f -newermt 2018-11-20 -not -newermt 2018-11-21 | tar -cvzf filename.tar.gz





    share|improve this answer








    New contributor




    Michael Quale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      0
      down vote













      I would use find then pipe that into tar u.



       find . -type f -newermt 2018-11-20 -not -newermt 2018-11-21 | tar -cvzf filename.tar.gz





      share|improve this answer








      New contributor




      Michael Quale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















        up vote
        0
        down vote










        up vote
        0
        down vote









        I would use find then pipe that into tar u.



         find . -type f -newermt 2018-11-20 -not -newermt 2018-11-21 | tar -cvzf filename.tar.gz





        share|improve this answer








        New contributor




        Michael Quale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        I would use find then pipe that into tar u.



         find . -type f -newermt 2018-11-20 -not -newermt 2018-11-21 | tar -cvzf filename.tar.gz






        share|improve this answer








        New contributor




        Michael Quale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        Michael Quale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered Nov 21 at 12:58









        Michael Quale

        11




        11




        New contributor




        Michael Quale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Michael Quale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Michael Quale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1094752%2ftar-a-file-from-directory-based-on-date%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

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

             ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕