From c4114c1c5e908782320969b6d7e9f46b9521749c Mon Sep 17 00:00:00 2001 From: Alban Bronisz Date: Fri, 3 Dec 2021 00:06:42 +0100 Subject: [PATCH] Doc --- README.md | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 0af6ff4..cc3cc94 100644 --- a/README.md +++ b/README.md @@ -26,26 +26,14 @@ python --version deactivate ``` -Configure the stats export --------------------------- -Open the cron tab in edition mode: +Export stats +------------ ```bash -crontab -e +./save_docker_stats.sh +or +python save_docker_stats.py ``` -Then add a new line (to run the check each 10 minutes) -```bash -*/10 * * * * /path/to/docker-stats-histo/save_docker_stats.sh > /dev/null 2>&1 -``` - - -**Note:** - - Normally cron send task outputs (echo) via mail. As the MTA (Mail Transfer Agent), -may not be set up, the crontab line redirect the outputs into `/dev/null`. -It can also be a path to a log file. - - No sudo is needed, crontab is called with current user. - - Display stats ------------- This step permits to generate an html interactive render from the sqlite stats file. @@ -61,6 +49,28 @@ The report is now accessible in `stats.html`. scp eunuque.caracals.org:/home/caracals/outils/docker-stats-histo/stats.sqlite . ``` + +Automations using cron +---------------------- +Open the cron tab in edition mode: +```bash +crontab -e +``` + +Then add those lines (to run the check each 10 minutes and a html generation each hour) +```bash +*/10 * * * * /path/to/docker-stats-histo/save_docker_stats.sh > /dev/null 2>&1 +00 */1 * * * /path/to/docker-stats-histo/generate_html.sh > /dev/null 2>&1 +``` + + +**Note:** + - Normally cron send task outputs (echo) via mail. As the MTA (Mail Transfer Agent), +may not be set up, the crontab line redirect the outputs into `/dev/null`. +It can also be a path to a log file. + - No sudo is needed, crontab is called with current user. + + Advanced parameters ------------------- Both python scripts can have a finer configuration (sqlite and html paths).