项目作者: pawandeepthind

项目描述 :
A simple configurable python script that archives files in folder that are older then configurable number of days.
高级语言: Python
项目地址: git://github.com/pawandeepthind/archiver.git
创建时间: 2018-10-17T03:04:04Z
项目社区:https://github.com/pawandeepthind/archiver

开源协议:MIT License

下载


archiver

A simple configurable python script that archives files in folder that are older then configurable number of days.

Script can be configured, using the archiver_config.json file. Some of the important flags in the confiigurable files,

configuration

  • debug - boolean - enable more verbose flags
  • remove_files - boolean - removes the original files once they are achived
  • archival_days - int - files older then these days will be archived when the script runs
  • archival_folder_name - _string - folder name in the current directory where the archives will be created
  • log_file_name - _string - file name for the log file
  • enable_disk_space_check - boolean - flag enables archiving only if used disk is above a limit set in configuration disk_space_check_percentage_limit
  • disk_space_check_percentage_limit - int - limit of used space when crossed, files older then archival_days will be archived
  • disk_path - string - path to find out the disk usage
  • folders - List of folder with following properties that enables archiving multiple folders
    • path - string - folder path to check files for archiving
    • description - string - just the description of the folder used for displaying information
    • archive_name_prefix - string - Archive file name prefix

process

  1. Checks if we have enabled disk check (if used disk is above a limit set in configuration, then it will compress and archive the files in a folder in current directory
  2. Reads the folders from configuration, and collects files that are older then configurable number of days and compress them.
  3. Remove the files once archived (controlled by a configuration)