mirror of
https://github.com/brmlab/brmbarSAP.git
synced 2025-06-07 19:24:02 +02:00
code import
This commit is contained in:
parent
5a102fcd5a
commit
fc36d54062
18 changed files with 1809 additions and 1 deletions
17
reports.sh
Executable file
17
reports.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# Send reports to all users with filled mail (from last midnight)
|
||||
|
||||
db="./brmbar.db"
|
||||
|
||||
usr=$(echo "SELECT name FROM users where mail!='';" | sqlite3 $db)
|
||||
|
||||
for u in $usr
|
||||
do
|
||||
m=$(echo "SELECT mail FROM users where name='"$u"';" | sqlite3 $db)
|
||||
l=$(echo ".headers on
|
||||
SELECT * FROM transhuman WHERE strftime('%Y-%m-%d',age)=date('now','localtime') AND user='$u';" | sqlite3 $db)
|
||||
|
||||
if [ -n "$l" ]; then
|
||||
echo "$l" | mail -s "brmbar report" "$m"
|
||||
fi
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue