Home | Trees | Index | Help |
|
---|
Package CedarBackup2 :: Module filesystem :: Class PurgeItemList |
|
object
--+ |list
--+ |FilesystemList
--+ | PurgeItemList
List of files and directories to be purged.
A PurgeItemList is a FilesystemList
containing a list of files
and directories to be purged. On top of the generic functionality
provided by FilesystemList
, this class adds
functionality to remove items that are too young to be purged, and to
actually remove each item in the list from the filesystem.
/opt/backup/collect
,
that directory doesn't get removed once all of the files within it is
gone.
Method Summary | |
---|---|
Initializes a list with no configured exclusions. | |
Adds the contents of a directory to the list. | |
Purges all items in the list. | |
Removes from the list files younger than a certain age (in days). | |
Inherited from FilesystemList | |
Adds a directory to the list. | |
Adds a file to the list. | |
Normalizes the list, ensuring that each entry is unique. | |
Removes directory entries from the list. | |
Removes file entries from the list. | |
Removes from the list all entries that do not exist on disk. | |
Removes soft link entries from the list. | |
Removes from the list all entries matching a pattern. | |
Verifies that all entries in the list exist on disk. | |
Inherited from list | |
x.__add__(y) <==> x+y | |
x.__contains__(y) <==> y in x | |
x.__delitem__(y) <==> del x[y] | |
Use of negative indices is not supported. | |
x.__eq__(y) <==> x==y | |
x.__ge__(y) <==> x>=y | |
x.__getattribute__('name') <==> x.name | |
x.__getitem__(y) <==> x[y] | |
Use of negative indices is not supported. | |
x.__gt__(y) <==> x>y | |
x.__hash__() <==> hash(x) | |
x.__iadd__(y) <==> x+=y | |
x.__imul__(y) <==> x*=y | |
x.__iter__() <==> iter(x) | |
x.__le__(y) <==> x<=y | |
x.__len__() <==> len(x) | |
x.__lt__(y) <==> x<y | |
x.__mul__(n) <==> x*n | |
x.__ne__(y) <==> x!=y | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
x.__repr__() <==> repr(x) | |
L.__reversed__() -- return a reverse iterator over the list | |
x.__rmul__(n) <==> n*x | |
x.__setitem__(i, y) <==> x[i]=y | |
Use of negative indices is not supported. | |
L.append(object) -- append object to end | |
L.count(value) -> integer -- return number of occurrences of value | |
L.extend(iterable) -- extend list by appending elements from the iterable | |
L.index(value, [start, [stop]]) -> integer -- return first index of value | |
L.insert(index, object) -- insert object before index | |
L.pop([index]) -> item -- remove and return item at index (default last) | |
L.remove(value) -- remove first occurrence of value | |
L.reverse() -- reverse *IN PLACE* | |
L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*; cmp(x, y) -> -1, 0, 1 | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Property Summary | |
---|---|
Inherited from FilesystemList | |
excludeDirs : Boolean indicating whether directories should be excluded. | |
excludeFiles : Boolean indicating whether files should be excluded. | |
excludeLinks : Boolean indicating whether soft links should be excluded. | |
excludePaths : List of absolute paths to be excluded. | |
excludePatterns : List of regular expression patterns to be excluded. | |
ignoreFile : Name of file which will cause directory contents to be ignored. |
Method Details |
---|
__init__(self)
Initializes a list with no configured exclusions.
|
addDirContents(self, path, recursive=True)Adds the contents of a directory to the list. The path must exist and must be a directory or a link to a directory. The contents of the directory (but not the directory path itself) will be recursively added to the list, subject to any exclusions that are in place. If you only want the directory and its contents to be added, then pass inrecursive=False .
|
purgeItems(self)Purges all items in the list. Every item in the list will be purged. Directories in the list will not be purged recursively, and hence will only be removed if they are empty. Errors will be ignored. To faciliate easy removal of directories that will end up being empty, the delete process happens in two passes: files first (including soft links), then directories.
|
removeYoungFiles(self, daysOld)Removes from the list files younger than a certain age (in days). Any file whose "age" in days is less than
( st_atime
and st_mtime values.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Dec 18 22:53:30 2006 | http://epydoc.sf.net |