mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
tmpfiles: stay on one file system when cleaning
Cleaning the directory of an entry with an age went into whatever was
mounted below it:
d /srv - - - 10d
tmpfiles --clean t.conf
With a disk mounted on /srv/data this removed every file on it older
than ten days.
Give nftw() FTW_MOUNT, so it stays on the file system of the directory.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
4 files changed
+47
-1
No files matched your search
+1
-1
@@ -831,7 +831,7 @@ static void tmpfiles(char *line)
|
||||
break;
|
||||
clean_age = max_age;
|
||||
clean_now = time(NULL);
|
||||
nftw(path, do_clean, 20, FTW_DEPTH | FTW_PHYS);
|
||||
nftw(path, do_clean, 20, FTW_DEPTH | FTW_PHYS | FTW_MOUNT);
|
||||
break;
|
||||
case 'x':
|
||||
case 'X':
|
||||
|
||||
Reference in new issue
Block a user