rotatingbackup.py
Bases: object
This class provides a rotating backup system.
Warning
Backups destination folder should not be the same than the folder containing the source to be backuped!
Usage:
>>> file = "File.txt"
>>> destination = "backup"
>>> backup = RotatingBackup(file, destination)
>>> backup.backup()
True
>>> for i in range(3):
... backup.backup()
...
True
True
True
>>> import os
>>> os.listdir(destination)
['File.txt', 'File.txt.1', 'File.txt.2', 'File.txt.3']
Parameters: |
|
---|
This method is the property for self.__source attribute.
Returns: | self.__source. ( String ) |
---|
This method is the property for self.__destination attribute.
Returns: | self.__destination. ( String ) |
---|