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"