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:
Guilherme Rugai Freire 2024-02-20 02:09:46 -03:00
parent 4ed9c46923
commit ed82c38af4
No known key found for this signature in database
GPG Key ID: AC1D9B6E48E16AC1

7
delete_old_mail.sh Executable file
View 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