https://github.com/junzhengca/traffic-fuse
A script to automatically shutdown your Linux server based on traffic usage.
https://github.com/junzhengca/traffic-fuse
Last synced: 2 months ago
JSON representation
A script to automatically shutdown your Linux server based on traffic usage.
- Host: GitHub
- URL: https://github.com/junzhengca/traffic-fuse
- Owner: junzhengca
- License: wtfpl
- Created: 2024-02-29T18:09:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-01T02:04:34.000Z (over 1 year ago)
- Last Synced: 2025-03-29T15:11:40.432Z (2 months ago)
- Language: Shell
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# traffic-fuse
A script to automatically shutdown your Linux server based on traffic usage.
⚠️ You should not use this for applications that requires high availability, as it will **shutdown** your server if the traffic usage is too high.
## Installation
Create a system crontab to run the script every 5 minutes, replace `eth0` with your network interface and `1000000000` with the maximum traffic usage in bytes for the 5 minute interval.
```bash
sudo echo "*/5 * * * * root /path/to/fuse.sh eth0 1000000000" > /etc/cron.d/traffic-fuse
```You are done, the system will now shutdown if the traffic usage is above the threshold you set for the 5 minute interval. In this case, 1GB.
## Notes
We compute both RX and TX traffic, so both download and upload traffic will be considered.