Skip to content

terry-xiaoyu/disc-sweeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

disc-sweeper

This is a small python script used to clean expired files on your server, if there is no enough disk space.

It uses following linux command to clean your server.

find /path/to/be/cleaned -mindepth 1 -mtime +{days_of_expiry} -depth -print > /path/to/log/sweep-date.log

It will also email you before the clean.

Please set the constants at the beginning of the script.

NOTE: Your email account should allow login from 'less-secured' apps

config the crontab

The following config runs a crontab task at 10:00 and 18:00 every day

cat /etc/crontab
0  10,18 * * * root python /data/disc-sweeper/discMonitor.py

Releases

No releases published

Packages

No packages published

Languages