When are files from /tmp deleted?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
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
linux rhel tmp
add a comment |Â
up vote
3
down vote
favorite
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
linux rhel tmp
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
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
linux rhel tmp
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
linux rhel tmp
edited Apr 18 at 10:30
asked Apr 18 at 10:23
menteith
1457
1457
add a comment |Â
add a comment |Â
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.
Thanks, that's it. On a side note, how do change file dates so that the file would be available forsystemd-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
add a comment |Â
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.
Thanks, that's it. On a side note, how do change file dates so that the file would be available forsystemd-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
add a comment |Â
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.
Thanks, that's it. On a side note, how do change file dates so that the file would be available forsystemd-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
add a comment |Â
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.
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.
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 forsystemd-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
add a comment |Â
Thanks, that's it. On a side note, how do change file dates so that the file would be available forsystemd-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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password