forked from symkat/Stalker
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated stalker.pl to update timestamp and added purge script
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
defaultdays=90 | ||
date=`date +%m-%d-%Y_%-H%M` | ||
|
||
case $1 in | ||
''|*[!0-9]*) | ||
days=$defaultdays ;; | ||
*) | ||
days=$1 ;; | ||
esac | ||
|
||
echo "This script will take a while to run and will likely make your irc" | ||
echo "connections time out. If you want to stop the stalker script in irssi," | ||
echo -n "do so now and hit enter when ready.." | ||
read $foo | ||
|
||
echo "" | ||
echo -n "Starting delete and vacuum for last ${days} days... " | ||
|
||
cp nicks.db nicks-${date}.db | ||
|
||
sqlite3 nicks.db \ | ||
"delete from records where added < date('now','-${days} days'); vacuum;" | ||
|
||
echo "Done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters