mirror of
https://github.com/GRFreire/nthmail.git
synced 2026-01-09 12:59:38 +00:00
add script to delete old mail
currently, the script is hardcoded for emails older than 1 day this is a script because it is a simple operation and probably will be called by a cronjob
This commit is contained in:
parent
4ed9c46923
commit
ed82c38af4
7
delete_old_mail.sh
Executable file
7
delete_old_mail.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
min_date="$(date -d '-1 day' +%s)"
|
||||
sql="DELETE FROM mails WHERE mails.arrived_at < $min_date;"
|
||||
|
||||
echo "$sql" | sqlite3 db.db
|
||||
|
||||
Loading…
Reference in New Issue
Block a user