An open API service indexing awesome lists of open source software.

https://github.com/terry-xiaoyu/disc-sweeper

A disk cleaner/sweeper useful to clean your expired files
https://github.com/terry-xiaoyu/disc-sweeper

clean cleaner delete-files disc disk finder linux sweep sweeper

Last synced: 29 days ago
JSON representation

A disk cleaner/sweeper useful to clean your expired files

Awesome Lists containing this project

README

          

## 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.
```shell
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
```shell
cat /etc/crontab
0 10,18 * * * root python /data/disc-sweeper/discMonitor.py
```