Mini-guide - 02/01/2017
An example script notifying the user when the space used exceeds a certain threshold.
The HTTP GET call structure is very simple.
|$token||Personal token.||Alphanumeric string|
|$testonoti||Notification text.||Text without spaces (use %20)|
You can use cron, a very popular tool to plan operations on linux systems. Change contab with
crontab -e. The syntax of the line to add is the following:
* * * * * /command/to/be/executed - - - - - | | | | | | | | | ----- Day of week (0 - 7) (Sunday=0 or 7) | | | ------- Month (1 - 12) | | --------- Day of month (1 - 31) | ----------- Hour (0 - 23) ------------- Minute (0 - 59)
For run the script on boot we can add line
@reboot /command/to/be/executed on crontab file.
The asterisk (*) operator specifies all possible values for a field. For example, an asterisk in the hour field would be equivalent to every hour or an asterisk in the month field would be equivalent to every month. In this specific example, an asterisk in all fields means run job every minute. We can edit our crontab with
crontab -e and add the line (after last line) about this script.
*/5 * * * * /home/gab/diskquota.sh
Where /home/gab/diskquota.sh is the position of the script in the device.
For the execution of the script authorizations are necessary. Authorizations can be give by entering
chmod 755 diskquota.sh