mfstrashretention(1)
π NAME π
okay so bestie, welcome to mfstrashretention β and yes, the whole thing is part of MooseFS (you can tell from the header, it literally says "This is part of MooseFS" π). It's the MooseFS trash retention management tools, and honestly? it's giving control-freak-in-the-best-way. it's a trio of little tools that let you peek at, change up, and copy over the β¨trash retentionβ¨ value of your filesystem objects. no cap.
β¨ SYNOPSIS β¨
mfsgettrashretention [-?] [-r] [-n|-h|-H|-k|-m|-g] OBJECT...
mfssettrashretention [-?] [-r] [-n|-h|-H|-k|-m|-g] TIME[+|-] OBJECT...
mfscopytrashretention [-?] [-r] [-n|-h|-H|-k|-m|-g] SOURCE_OBJECT
OBJECT...
πΈ DESCRIPTION πΈ
so these tools all mess with one specific thing: a filesystem object's trash retention value. and a "filesystem object" here means a file, a special file, or a directory β all three count, periodt.
what is the trash retention value, you ask? it's literally the time the file is preserved in the special trash directory before it's finally removed from the filesystem. think of it like a lil grace period before the object is gone-gone. and heads up: trash retention must be a non-negative integer. no negative vibes allowed π ββοΈ
mfsgettrashretention prints the current trash retention value of whatever object(s) you hand it. the -r option turns on recursive mode, which works as usual for every given file β but for every given directory it additionally prints the current trash retention value of all the objects contained inside it (files and directories both, bestie, all of them).
mfssettrashretention changes the current trash retention value of your given object(s). here's the cute part, listen up:
- if you write the new value in
TIME+form, the trash retention value gets increased toTIMEfor objects that have a lower trash retention value, and it stays unchanged for everybody else. - similarly, if you write the new value as
TIME-, the trash retention value gets decreased toTIMEfor objects that have a higher trash retention value, and it stays unchanged for the rest.
-r enables recursive mode here too. and a fun fact: these tools can be used on any file, directory, or deleted (trash) file. slay π
mfscopytrashretention does exactly what it sounds like β it copies the trash retention value from one object to another. one object's energy, transferred to another π¦
the TIME parameter is specified as a general time type value, with its minimum unit being hours, and with the additional possibility of adding a + or - sign at the end. for the full deets on the time format, scroll your eyes down to TIME π
π OPTIONS π
okay so first, the group thing β most MooseFS tools (including these) use -n, -h, -H, -k, -m and -g to pick the format of printed numbers.
-nβ prints exact numbers. the "no thoughts, just the real digits" option.-hβ uses binary prefixes (Ki,Mi,Gias 2^10, 2^20 etc.). iykyk.-Hβ uses SI prefixes (k,M,Gas 10^3, 10^6 etc.). the metric system said hi π«Ά-kβ shows plain numbers in kibis (binary kilo β 1024).-mβ shows plain numbers in mebis (binary mega β 1024^2).-gβ shows plain numbers in gibis (binary giga β 1024^3).-rβ recursive mode, bb. for files it just works as usual; for directories it also reaches down into everything contained inside.-?β displays the short usage message. the "help me bestie" button π
and the same number-formatting magic can be achieved by setting the MFSHRFORMAT environment variable to one of these:
0β exact numbers1orhβ binary prefixes2orHβ SI prefixes3orh+β exact numbers and binary prefixes4orH+β exact numbers and SI prefixes
the default is to print just exact numbers. simple. clean. iconic.
π NOTES π
β° TIME
for time variables, the value can be defined as a number of seconds or hours (integer), depending on the minimum unit of that variable β orrrr as a time period in one of two possible formats:
first format: #.#T where T is one of: s-seconds, m-minutes, h-hours, d-days or w-weeks. note that fractions of the minimum unit will be rounded to an integer value (so don't come crying about your .5s, they're getting rounded π).
second format: #w#d#h#m#s β any number of definitions can be omitted, but the remaining definitions must be in order. so #d#m is still a valid definition, but #m#d is not. and the ranges are:
s,m: 0 to 59h: 0 to 23d: 0 to 6wis unlimited, and the first definition is also always unlimited (i.e. for#d#h#m,dwill be unlimited)
if a minimum unit of a variable is larger than seconds, units below the minimum one will not be accepted. for example, a variable that has hours as a minimum unit will not accept s and m units. no exceptions, bestie.
Examples:
1.5d is the same as 1d12h, is the same as 36h
2.5w is the same as 2w3d12h, is the same as 420h; 2w84h is not a valid
time period (h is not the first definition, so it is bound by range 0 to
23)
see that 2w84h? π© not valid. h is not the first definition, so it's bound by the range 0 to 23. the math is mathing.
𧬠INHERITANCE
when a new object is created in MooseFS, its trash retention is inherited from the parent directory. a newly created object always inherits the current value of its parent's trash retention β it's giving family heirloom energy, lowkey.
but here's the important bit: changing a directory's trash retention does not affect its already created children. they've already moved out, they have their own lives now π. if you do want to change trash retention for a directory and all of its children, use the -r option. that's the group-chat-wide announcement π’
π REPORTING BUGS π
found a bug? not the vibe. report it to <bugs@moosefs.com>.
π COPYRIGHT π
Copyright (C) 2026 Jakub Kruszona-Zawadzki, Saglabs SA
This file is part of MooseFS.
MooseFS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 (only).
MooseFS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see <https://www.gnu.org/licenses/>.
π«Ά SEE ALSO π«Ά
and that's the whole page, bestie π this was MooseFS 4.59.2-1, dated May 2026 β go forth and manage those retention values like the main character you are β¨ππ
π¦ where this page comes from
- arch rolling: moosefs 4.59.2-2 Β· GPL-2.0-only
- nixos 26.05: moosefs 4.59.2
- nixpkgs unstable: moosefs 4.59.2
- ubuntu stonking: moosefs-client 4.59.2-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms