nthmail/delete_old_mail.sh
Guilherme Rugai Freire ed82c38af4
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
2024-02-20 02:09:46 -03:00

8 lines
136 B
Bash
Executable File

#!/bin/sh
min_date="$(date -d '-1 day' +%s)"
sql="DELETE FROM mails WHERE mails.arrived_at < $min_date;"
echo "$sql" | sqlite3 db.db