GoAdmio Command Line: bandwidth with /go/bandwidth

/go/bandwidth measures how much traffic every hosted domain has used this month and saves the total in GoAdmio. For each domain it: The command does not set or enforce limits. Limits are set when the account is created (see create, –bandwidth); this command keeps the usage figure up to date. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Update bandwidth usage for all domains
/go/bandwidth

Run it on a schedule (for example once a day from cron) so every day has a row.

Options

None. Any arguments you pass are ignored.

Examples

# Run once, for all domains
/go/bandwidth

# Run every day at 00:10 (cron entry)
10 0 * * * /go/bandwidth

# Check the stored monthly usage of one domain (bytes)
sqlite3 /var/lib/sqlite/site.db "select BandwidthUsed from Site where Domain='example.com'"

# See the daily rows saved for a domain
sqlite3 /var/lib/sqlite/bandwidth.db "select Date,Bandwidth from Bandwidth where Domain='example.com' order by TimeStamp"

Output

The command prints nothing. Check the results in the databases or the log.

What Where
Daily HTTP bytes per domain Bandwidth table in /var/lib/sqlite/bandwidth.db
Monthly total per domain (bytes) BandwidthUsed column of the Site table in /var/lib/sqlite/site.db
Record of each run /var/log/go/bandwidth.log

Each run adds one line to the log, in this form:

[Nov 20 00:10:01]# bandwidth

See the full reference at /go/bandwidth and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *