Permalink
Browse files

Merge pull request #574 from Kegeruneku/add_year_to_minute_file_selec…

…t_bodies_to_stdlib

cfengine_stdlib.cf: Create a generic older_than file_select body in the stdlib, to cover sel...
  • Loading branch information...
tzz committed Apr 25, 2013
2 parents a8195c1 + 51abd95 commit 2652ca0575b8e5457faab8f51f2fe30a26a29fcd
Showing with 10 additions and 0 deletions.
  1. +10 −0 masterfiles/libraries/cfengine_stdlib.cf
@@ -1546,6 +1546,16 @@ file_result => "leaf_name";
##
+body file_select older_than(years, months, days, hours, minutes, seconds)
+# Generic older_than selection body, aimed to have a common definition handy
+# for every case possible.
+{
+mtime => irange(0,ago("$(years)","$(months)","$(days)","$(hours)","$(minutes)","$(seconds)"));
+file_result => "mtime";
+}
+
+##
+
body file_select filetype_older_than(filetype, days)
# Select files of specified type older than specified number of days
# Note: This body only takes a single filetype, see filetypes_older_than

0 comments on commit 2652ca0

Please sign in to comment.