Difference: SCSArchiverCSStudioLoadSchemeGrants (1 vs. 4)

Revision 4
01 Jun 2016 - Main.PeterZumbruch
Line: 1 to 1
 
META TOPICPARENT name="SCSArchiverCSStudio"
<--  
-->

SCSArchiver CSStudio Load Scheme Grants

Deleted:
<
<

Introduction

 

Line: 19 to 16
 
    • option "-a" to show all

%CODE{"bash"}%
Changed:
<
<
export PGUSER=
>
>
export archive=<(list of) archiver_user(s)>)> export report=<(list of) report_user(s)>)> export PGUSER=
  export PGHOST=%database_host% export PGPORT=%port% export PGDATABASE=%database% schema=%schema%
Changed:
<
<
URL=%url% filename=$(basename $URL) outputdir=$(mktemp -d) outputfile=$(mktemp -p $outputdir) ; cat > $outputfile << EOF
>
>
URL=%url% filename=$(basename $URL ) outputdir=$(mktemp -d); outputfile=$(mktemp -p ${outputdir}) ; cat > ${outputfile} << EOF
 

SET client_encoding = "UTF-8"; SET SEARCH PATH TO "$schema"; EOF
Added:
>
>
cd ${outputdir} && wget -N --no-check-certificate ${URL} &&
  for item in $(echo $archive); do
Changed:
<
<
perl -ne 'if (/^\bGRANT\b/ ... / TO (\w+);/m) {~s/^-- .*?\n//g; ~ s/\n/ /g; ~s/;\s*/;\n/g; print;}' $filename | perl -ne "if (/TO archive/) {~s/TO archive/TO $item/g;print;}" >> $outputfile
>
>
perl -ne 'if (/^\bGRANT\b/ ... / TO (\w+);/m) {~s/^-- .*?\n//g; ~ s/\n/ /g; ~s/;\s*/;\n/g; print;}' ${filename} | perl -ne "if (/TO archive/) {~s/TO archive/TO $item/g;print;}" >> $outputfile
  done for item in $(echo $report); do
Changed:
<
<
perl -ne 'if (/^\bGRANT\b/ ... / TO (\w+);/m) {~s/^-- .*?\n//g; ~ s/\n/ /g; ~s/;\s*/;\n/g; print;}' $filename | perl -ne "if (/TO report/) {~s/TO report/TO $item/g;print;}" >> $outputfile
>
>
perl -ne 'if (/^\bGRANT\b/ ... / TO (\w+);/m) {~s/^-- .*?\n//g; ~ s/\n/ /g; ~s/;\s*/;\n/g; print;}' ${filename} | perl -ne "if (/TO report/) {~s/TO report/TO $item/g;print;}" >> $outputfile
  done psql -a -f $outputfile &&
Changed:
<
<
rm -ir ${outputdir}
>
>
cd - && rm -ir ${outputdir} && unset outputdir outputfile archive report
  %ENDCODE%


Changed:
<
<
-- PeterZumbruch - 04 May 2016
>
>
-- PeterZumbruch - 01 Jun 2016
Revision 3
04 May 2016 - Main.PeterZumbruch
Line: 1 to 1
 
META TOPICPARENT name="SCSArchiverCSStudio"