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
- Host: GitHub
- URL: https://github.com/terry-xiaoyu/disc-sweeper
- Owner: terry-xiaoyu
- License: mit
- Created: 2017-08-02T08:11:33.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-03T01:48:52.000Z (almost 9 years ago)
- Last Synced: 2025-10-03T19:34:35.846Z (9 months ago)
- Topics: clean, cleaner, delete-files, disc, disk, finder, linux, sweep, sweeper
- Language: Python
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```