X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fcats%2Fmake_catalog_backup.in;h=b27ffb77d94fe78baff684b0b24a953295638ad9;hb=f5984fe3b5fe567e1609078ed5966f4d0428f0a7;hp=18c28216083324d340729d3ffa6e6cd79170c1d4;hpb=e54e457692ad233211799c558ddf9d76083cdb22;p=bacula%2Fbacula diff --git a/bacula/src/cats/make_catalog_backup.in b/bacula/src/cats/make_catalog_backup.in index 18c2821608..b27ffb77d9 100755 --- a/bacula/src/cats/make_catalog_backup.in +++ b/bacula/src/cats/make_catalog_backup.in @@ -8,7 +8,11 @@ # $2 is the user name with which to access the database # (default = bacula). # $3 is the password with which to access the database or "" if no password -# (default "") +# (default ""). WARNING!!! Passing the password via the command line is +# insecure and should not be used since any user can display the command +# line arguments and the environment using ps. Please consult your +# MySQL or PostgreSQL manual for secure methods of specifying the +# password. # $4 is the host on which the database is located # (default "") # @@ -31,7 +35,7 @@ else else MYSQLHOST="" fi - ${BINDIR}/mysqldump -u $2$MYSQLPASSWORD$MYSQLHOST -f --opt $1 >$1.sql + ${BINDIR}/mysqldump -u ${2}${MYSQLPASSWORD}${MYSQLHOST} -f --opt $1 >$1.sql else if test xpostgresql = x@DB_TYPE@ ; then if test $# -gt 2; then @@ -43,6 +47,7 @@ else else PGHOST="" fi + # you could also add --compress for compression. See man pg_dump exec ${BINDIR}/pg_dump -c $PGHOST -U $2 $1 >$1.sql else echo ".dump" | ${BINDIR}/sqlite3 $1.db >$1.sql @@ -63,6 +68,6 @@ fi # To read back a PostgreSQL database use: # cd @working_dir@ # dropdb bacula -# createdb bacula +# createdb bacula -T template0 -E SQL_ASCII # psql bacula