https://github.com/r3code/php-du-notifier
Small PHP script to notify an admin by email of how much space allocated by web sites on shared hosting
https://github.com/r3code/php-du-notifier
cron-script cronjob disk-space disk-usage hosting php
Last synced: 3 months ago
JSON representation
Small PHP script to notify an admin by email of how much space allocated by web sites on shared hosting
- Host: GitHub
- URL: https://github.com/r3code/php-du-notifier
- Owner: r3code
- Created: 2017-04-14T11:14:16.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T13:38:10.000Z (almost 9 years ago)
- Last Synced: 2025-06-03T21:35:58.547Z (8 months ago)
- Topics: cron-script, cronjob, disk-space, disk-usage, hosting, php
- Language: PHP
- Size: 81.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# php-du-notifier
PHP script to notify an admin by email of how much space allocated by web sites on shared Linux hosting.
## Install
Download and copy files to your shared hosting.
## Config
Edit `config.json` before use.
Config fields are:
```
rootDir - absoulte path to your account on web-hosting,
totalDiskQuotaMb - total accoun space limit in megabytes,
maxSiteCount - sites count used to calculate per site space limit, typycally allowed by tariff,
reportInfo - contains report config,
mailFrom - e-mail addres to use as from header (e.g. status@example.org),
name - title for the report,
type - (html|plain) type of generated report,
sites - (array) of site info, with structure:
domain - domain name,
path - path to site dir from `rootDir`
```
### Mail report every moth
Allow to execute `dunotifier.php`, e.g. `chmod +x dunotifier.php` to allow run from cron.
Configure cron task to run `/path-to-scripts/dunotifier.php -m mailme@example.org` for example once a month.
It will send you a letter with a report once a month.
### Instant report
Open your web site at http://site.com/path-to-scripts/dunotifier.php to see the html report.
Set password for this folder to protect it from undesired access.
## Email Report Example
The letter in Gmail interface.

## Online HTML Report Example
See below.
