mirror of
https://github.com/GRFreire/nthmail.git
synced 2026-01-09 12:59:38 +00:00
update delete_old_mail.sh to use DB_PATH var
This commit is contained in:
parent
a4efa6a35f
commit
117766dd64
@ -1,7 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$DB_PATH" ]; then
|
||||
DB_PATH="db.db"
|
||||
fi
|
||||
|
||||
min_date="$(date -d '-1 day' +%s)"
|
||||
sql="DELETE FROM mails WHERE mails.arrived_at < $min_date;"
|
||||
|
||||
echo "$sql" | sqlite3 db.db
|
||||
echo "$sql" | sqlite3 "$DB_PATH"
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user