Skip to content

Instantly share code, notes, and snippets.

@uzi18
Created February 3, 2021 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uzi18/259af8878c95862fa882f213c27737af to your computer and use it in GitHub Desktop.
Save uzi18/259af8878c95862fa882f213c27737af to your computer and use it in GitHub Desktop.
nettemp remove data before 365 days
#! /bin/bash
db=$(ls /var/www/nettemp/db)
for i in $db
do
sqlite3 /var/www/nettemp/db/$i "DELETE FROM def WHERE time <= date('now','-365 day'); VACUUM;"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment