When are files from /tmp deleted?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite
1












I'd like to investigate when files in /tmp get removed. I run CentOS 7. Policy regarding deleting files from that directory is governed as follows:




RHEL7 and RedHat-like with systemd it's configured in
/usr/lib/tmpfiles.d/tmp.conf, called by systemd-tmpfiles-clean.service)




I guess that three-year-old files are old enough to be deleted. So I set access time this way



find /tmp/payaramicro*tmp -exec touch -m -a -t 201512180130.09 ;


However, when I run systemd-tmpfiles --clean those files won't get deleted. Why? Perhaps it has something to do with their dates as stat some-file shows today's date in one of its lines in output:




Access: 2015-12-18 01:30:09.000000000 +0100
Modify: 2015-12-18 01:30:09.000000000 +0100
Change: 2018-04-18 12:20:54.095962410 +0200








share|improve this question

























    up vote
    3
    down vote

    favorite
    1












    I'd like to investigate when files in /tmp get removed. I run CentOS 7. Policy regarding deleting files from that directory is governed as follows:




    RHEL7 and RedHat-like with systemd it's configured in
    /usr/lib/tmpfiles.d/tmp.conf, called by systemd-tmpfiles-clean.service)




    I guess that three-year-old files are old enough to be deleted. So I set access time this way



    find /tmp/payaramicro*tmp -exec touch -m -a -t 201512180130.09 ;


    However, when I run systemd-tmpfiles --clean those files won't get deleted. Why? Perhaps it has something to do with their dates as stat some-file shows today's date in one of its lines in output:




    Access: 2015-12-18 01:30:09.000000000 +0100
    Modify: 2015-12-18 01:30:09.000000000 +0100
    Change: 2018-04-18 12:20:54.095962410 +0200








    share|improve this question























      up vote
      3
      down vote

      favorite
      1









      up vote
      3
      down vote

      favorite
      1






      1





      I'd like to investigate when files in /tmp get removed. I run CentOS 7. Policy regarding deleting files from that directory is governed as follows:




      RHEL7 and RedHat-like with systemd it's configured in
      /usr/lib/tmpfiles.d/tmp.conf, called by systemd-tmpfiles-clean.service)




      I guess that three-year-old files are old enough to be deleted. So I set access time this way



      find /tmp/payaramicro*tmp -exec touch -m -a -t 201512180130.09 ;


      However, when I run systemd-tmpfiles --clean those files won't get deleted. Why? Perhaps it has something to do with their dates as stat some-file shows today's date in one of its lines in output:




      Access: 2015-12-18 01:30:09.000000000 +0100
      Modify: 2015-12-18 01:30:09.000000000 +0100
      Change: 2018-04-18 12:20:54.095962410 +0200








      share|improve this question













      I'd like to investigate when files in /tmp get removed. I run CentOS 7. Policy regarding deleting files from that directory is governed as follows:




      RHEL7 and RedHat-like with systemd it's configured in
      /usr/lib/tmpfiles.d/tmp.conf, called by systemd-tmpfiles-clean.service)




      I guess that three-year-old files are old enough to be deleted. So I set access time this way



      find /tmp/payaramicro*tmp -exec touch -m -a -t 201512180130.09 ;


      However, when I run systemd-tmpfiles --clean those files won't get deleted. Why? Perhaps it has something to do with their dates as stat some-file shows today's date in one of its lines in output:




      Access: 2015-12-18 01:30:09.000000000 +0100
      Modify: 2015-12-18 01:30:09.000000000 +0100
      Change: 2018-04-18 12:20:54.095962410 +0200










      share|improve this question












      share|improve this question




      share|improve this question








      edited Apr 18 at 10:30
























      asked Apr 18 at 10:23









      menteith

      1457




      1457




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          5
          down vote



          accepted










          Yes, systemd-tmpfiles --clean considers change times too. You can see this by running it with debug logs enabled:



          SYSTEMD_LOG_LEVEL=debug systemd-tmpfiles --clean


          You’ll see it mentioning that the change time is too new.






          share|improve this answer





















          • Thanks, that's it. On a side note, how do change file dates so that the file would be available for systemd-tmpfiles --clean?
            – menteith
            Apr 18 at 11:17










          • You can’t control the change time (other than by changing your system’s notion of the current time).
            – Stephen Kitt
            Apr 18 at 11:53










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f438471%2fwhen-are-files-from-tmp-deleted%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          5
          down vote



          accepted










          Yes, systemd-tmpfiles --clean considers change times too. You can see this by running it with debug logs enabled:



          SYSTEMD_LOG_LEVEL=debug systemd-tmpfiles --clean


          You’ll see it mentioning that the change time is too new.






          share|improve this answer





















          • Thanks, that's it. On a side note, how do change file dates so that the file would be available for systemd-tmpfiles --clean?
            – menteith
            Apr 18 at 11:17










          • You can’t control the change time (other than by changing your system’s notion of the current time).
            – Stephen Kitt
            Apr 18 at 11:53














          up vote
          5
          down vote



          accepted










          Yes, systemd-tmpfiles --clean considers change times too. You can see this by running it with debug logs enabled:



          SYSTEMD_LOG_LEVEL=debug systemd-tmpfiles --clean


          You’ll see it mentioning that the change time is too new.






          share|improve this answer





















          • Thanks, that's it. On a side note, how do change file dates so that the file would be available for systemd-tmpfiles --clean?
            – menteith
            Apr 18 at 11:17










          • You can’t control the change time (other than by changing your system’s notion of the current time).
            – Stephen Kitt
            Apr 18 at 11:53












          up vote
          5
          down vote



          accepted







          up vote
          5
          down vote



          accepted






          Yes, systemd-tmpfiles --clean considers change times too. You can see this by running it with debug logs enabled:



          SYSTEMD_LOG_LEVEL=debug systemd-tmpfiles --clean


          You’ll see it mentioning that the change time is too new.






          share|improve this answer













          Yes, systemd-tmpfiles --clean considers change times too. You can see this by running it with debug logs enabled:



          SYSTEMD_LOG_LEVEL=debug systemd-tmpfiles --clean


          You’ll see it mentioning that the change time is too new.







          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered Apr 18 at 11:10









          Stephen Kitt

          140k22303364




          140k22303364











          • Thanks, that's it. On a side note, how do change file dates so that the file would be available for systemd-tmpfiles --clean?
            – menteith
            Apr 18 at 11:17










          • You can’t control the change time (other than by changing your system’s notion of the current time).
            – Stephen Kitt
            Apr 18 at 11:53
















          • Thanks, that's it. On a side note, how do change file dates so that the file would be available for systemd-tmpfiles --clean?
            – menteith
            Apr 18 at 11:17










          • You can’t control the change time (other than by changing your system’s notion of the current time).
            – Stephen Kitt
            Apr 18 at 11:53















          Thanks, that's it. On a side note, how do change file dates so that the file would be available for systemd-tmpfiles --clean?
          – menteith
          Apr 18 at 11:17




          Thanks, that's it. On a side note, how do change file dates so that the file would be available for systemd-tmpfiles --clean?
          – menteith
          Apr 18 at 11:17












          You can’t control the change time (other than by changing your system’s notion of the current time).
          – Stephen Kitt
          Apr 18 at 11:53




          You can’t control the change time (other than by changing your system’s notion of the current time).
          – Stephen Kitt
          Apr 18 at 11:53












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f438471%2fwhen-are-files-from-tmp-deleted%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay