Commit 97a60399e434179d1e6ab0974f43c0fbd62f8906
1 parent
444e7283
fix bugs in remove_backup_emails script
- parse all files looking for emails before substitutions - do not look for emails in mailman pickled files, but apply the substitutions in them. It assumes all emails in the mailing lists are registered in colab, noosfero or gitlab.
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
utils/remove_backup_emails.rb
@@ -51,10 +51,14 @@ decompress | @@ -51,10 +51,14 @@ decompress | ||
51 | noosfero_sql = File.basename(Find.find('./noosfero/tmp/').grep(/\.sql/)[0]) | 51 | noosfero_sql = File.basename(Find.find('./noosfero/tmp/').grep(/\.sql/)[0]) |
52 | noosfero_sql = Find.find('./noosfero/tmp/').grep(/\.sql/)[0] | 52 | noosfero_sql = Find.find('./noosfero/tmp/').grep(/\.sql/)[0] |
53 | deEmailedFiles = ['colab.dump', 'gitlab/db/database.sql', noosfero_sql] | 53 | deEmailedFiles = ['colab.dump', 'gitlab/db/database.sql', noosfero_sql] |
54 | -deEmailedFiles += Find.find('./mailman/lists/').grep(/config\.pck/) | ||
55 | 54 | ||
56 | deEmailedFiles.each do |deEmailedFile| | 55 | deEmailedFiles.each do |deEmailedFile| |
57 | create_hashes_from_file(deEmailedFile) | 56 | create_hashes_from_file(deEmailedFile) |
57 | +end | ||
58 | + | ||
59 | +deEmailedFiles += Find.find('./mailman/lists/').grep(/config\.pck/) | ||
60 | + | ||
61 | +deEmailedFiles.each do |deEmailedFile| | ||
58 | substitute_hashes_in_file(deEmailedFile) | 62 | substitute_hashes_in_file(deEmailedFile) |
59 | end | 63 | end |
60 | recompress | 64 | recompress |