Symantec logo

DELETE statement

The DELETE file placement policy rule statement is very similar to the RELOCATE statement in both form and function, lacking only the <TO> clause. File placement policy-based deletion may be thought of as relocation with a fixed destination.

The following XML snippet illustrates the general form of the DELETE statement:

<DELETE>

<FROM>

<SOURCE>

<CLASS>...placement_class_name...</CLASS>

</SOURCE>

<SOURCE>

...additional placement class specifications...

</SOURCE>

</FROM>

<WHEN>...relocation conditions...</WHEN>

</DELETE>

A DELETE statement contains the following clauses:

<FROM> 

An optional clause that contains a list of placement classes from whose volumes designated files should be deleted if the files meet the conditions specified in the <WHEN> clause. No priority is associated with the ordering of placement classes in a <FROM> clause. If a file to which the rule applies is located on a volume in any specified placement class, the file is deleted. If a DELETE statement does not contain a <FROM> clause, VxFS deletes qualifying files no matter on which of a file system's volumes the files reside. 

<WHEN> 

An optional clause indicating the conditions under which files to which the rule applies should be deleted. The form of the <WHEN> clause in a DELETE statement is identical to that of the <WHEN> clause in a RELOCATE statement. If a DELETE statement does not contain a <WHEN> clause, files designated by the rule's SELECT statement, and the <FROM> clause if it is present, are deleted unconditionally. 

DELETE statement examples

The following example illustrates the use of the DELETE statement:

<DELETE>

<FROM>

<SOURCE>

<CLASS>tier3</CLASS>

</SOURCE>

</FROM>

</DELETE>

<DELETE>

<FROM>

<SOURCE>

<CLASS>tier2</CLASS>

</SOURCE>

</FROM>

<WHEN>

<ACCAGE Units="days">

<MIN Flags="gt">120</MIN>

</ACCAGE>

</WHEN>

</DELETE>

The first DELETE statement unconditionally deletes files designated by the rule's SELECT statement that reside on tier3 volumes when the fsppadm enforce command is issued. The absence of a <WHEN> clause in the DELETE statement indicates that deletion of designated files is unconditional.

The second DELETE statement deletes files to which the rule applies that reside on tier2 volumes when the fsppadm enforce command is issued and that have not been accessed for the past 120 days.