source: npl/mailserver/dspam/updateglobaldb.sh @ 26ffad7

Last change on this file since 26ffad7 was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 683 bytes
Line 
1#!/bin/bash
2SERVER=root@a.datux.nl
3SPAMUSER=psy
4
5echo "Dumping spamdatabase from $SERVER, user $SPAMUSER..."
6ssh $SERVER "dspam_2sql $SPAMUSER" > dump.sql || exit 1
7
8rm global.sql* 2>/dev/null
9
10echo "begin;" >> global.sql
11echo "delete from dspam_preferences where uid=1;" >> global.sql
12echo "delete from dspam_signature_data where uid=1;" >> global.sql
13echo "delete from dspam_stats where uid=1;" >> global.sql
14echo "delete from dspam_token_data where uid=1;" >> global.sql
15
16sed 's/values([0-9]*,/values(1,/' dump.sql >> global.sql
17
18echo "commit;" >> global.sql
19
20gzip global.sql
21
22
23rm dump.sql
24
25echo "Ok done, global.sql.gz is updated with filter of $SPAMUSER from server $SERVER !"
Note: See TracBrowser for help on using the repository browser.