aboutsummaryrefslogtreecommitdiff
path: root/cli/README.md
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-07-25 16:51:48 +0200
committerGravatar GitHub <noreply@github.com> 2019-07-25 16:51:48 +0200
commit82611c9622ed23b0e9fcf5f9f651ddffa1fd7706 (patch)
treefc2c97fd8dd84ec30473cb85b889d8326c9a831a /cli/README.md
parent744a9e8cf00aef7dec0acfa5f90f0dcfa2ef8837 (diff)
parent042b40eeeea77db854daab1bec96fce5c2cdd4b2 (diff)
Merge pull request #2451 from FreshRSS/dev1.14.3
FreshRSS 1.14.3
Diffstat (limited to 'cli/README.md')
-rw-r--r--cli/README.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/cli/README.md b/cli/README.md
index 9c87c394e..e9e336439 100644
--- a/cli/README.md
+++ b/cli/README.md
@@ -78,6 +78,22 @@ cd /usr/share/FreshRSS
# Optimize database (reduces the size) for a given user (perform `OPTIMIZE TABLE` in MySQL, `VACUUM` in SQLite)
```
+#### Note about cron
+
+Some commands display informations on standard error, cron will send an email with thoses informations every time the command will be executed (exited zero or non-zero).
+
+To avoid cron sending email on success:
+```sh
+@daily /usr/local/bin/my-command > /var/log/cron-freshrss-stdout.log 2>/var/log/cron-freshrss-stderr.log || cat /var/log/cron-freshrss-stderr.log
+```
+
+Explanations:
+- _/usr/local/bin/my-command > /var/log/cron-freshrss-stdout.log_ : redirect the standard output to a log file
+- _/usr/local/bin/my-command 2> /var/log/cron-freshrss-stderr.log_ : redirect the standard error to a log file
+- _|| cat /var/log/cron-freshrss-stderr.log_ : if the exit code of _/usr/local/bin/my-command_ is non-zero, then it send by mail the content error file.
+
+Now, cron will send you an email only if the exit code is non-zero and with the content of the file containing the errors.
+
## Unix piping