mfstrashretention(1)

NAME
mfstrashretention - MooseFS trash retention management tools

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
These tools operate on object's trash retention value, i.e. the time the file is preserved in special trash directory before it's finally removed from filesystem. Trash retention must be a non-negative integer value.

mfsgettrashretention prints current trash retention value of given object(s). -r option enables recursive mode, which works as usual for every given file, but for every given directory additionally prints current trash retention value of all contained objects (files and directories).

mfssettrashretention changes current trash retention value of given object(s). If new value is specified in TIME+ form, trash retention value is increased to TIME for objects with lower trash retention value and unchanged for the rest. Similarly, if new value is specified as TIME-, trash retention value is decreased to TIME for objects with higher trash retention value and unchanged for the rest. -r option enables recursive mode. These tools can be used on any file, directory or deleted (trash) file.

mfscopytrashretention tool can be used to copy trash retention value from one object to another.

TIME parameter is specified as a general time type value, with minimum unit being hours and with an additional possibility of adding a + or - sign at the end; for details about time format see TIME

TIME

For time variables their value can be defined as a number of seconds or hours (integer), depending on minimum unit of the variable, or 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; fractions of minimum unit will be rounded to integer value

second format: #w#d#h#m#s, any number of definitions can be ommited, but the remaining definitions must be in order (so #d#m is still a valid definition, but #m#d is not); ranges: s,m: 0 to 59, h: 0 to 23, d: 0 t o 6, w is unlimited and the first definition is also always unlimited (i.e. for #d#h#m d will 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.

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)

GENERAL OPTIONS
Most MooseFS tools use -n, -h, -H, -k, -m and -g options to select format of printed numbers. -n causes to print exact numbers, -h uses binary prefixes (Ki, Mi, Gi as 2^10, 2^20 etc.) while -H uses SI prefixes (k, M, G as 10^3, 10^6 etc.). -k, -m and -g show plain numbers respectivaly in kibis (binary kilo - 1024), mebis (binary mega - 1024^2) and gibis (binary giga - 1024^3). The same can be achieved by setting MFSHRFORMAT environment variable to: 0 (exact numbers), 1 or h (binary prefixes), 2 or H (SI prefixes), 3 or h+ (exact numbers and binary prefixes), 4 or H+ (exact numbers and SI prefixes). The default is to print just exact numbers.

Option -? displays short usage message.

INHERITANCE
When a new object is created in MooseFS, trash retention is inherited from the parent directory. A newly created object inherits always the current value of its parent's trash retention. Changing a directory's trash retention does not affect its already created children. To change trash retention for a directory and all of its children use -r option.

REPORTING BUGS
Report bugs to <bugs@moosefs.com>.

COPYRIGHT
Copyright (C) 2025 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 MooseFS; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA or visit http://www.gnu.org/licenses/gpl-2.0.html

SEE ALSO
mfsmount(8), mfstools(1)