From 0dfa56fba781d431f2946456c81f3d5beb51a700 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 2 Aug 2019 09:05:21 -0400 Subject: [PATCH] Add "export grade" cleaning to srht-replicate-db --- srht-replicate-db | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/srht-replicate-db b/srht-replicate-db index 11224b1..2b7f795 100755 --- a/srht-replicate-db +++ b/srht-replicate-db @@ -5,15 +5,23 @@ # Usage: # # ssh prod.database pg_dump database-name \ -# | ./srht-replicate-db [-e ] database-name +# | ./srht-replicate-db [-e ] [-x] database-name +# +# -x will delete extra data for a database dump which is suitable to give to +# third parties by removing all non-public information. This is only supported +# for git.sr.ht and hg.sr.ht. email_domain=example.org +export_grade=0 while getopts e: name do case $name in e) email_domain="$OPTARG" ;; + x) + export_grade=1 + ;; ?) echo "Invalid usage" >&2 exit 1 @@ -30,22 +38,49 @@ fi database="$1" -dropdb "$1"