HCoop
/
hcoop
/
scripts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
109a1b3
)
hcoop-all-db-backup: switch cwd to tmpdir
author
Clinton Ebadi
<clinton@unknownlamer.org>
Thu, 4 Apr 2019 01:35:15 +0000
(21:35 -0400)
committer
Clinton Ebadi
<clinton@unknownlamer.org>
Thu, 4 Apr 2019 01:35:15 +0000
(21:35 -0400)
postgres commands complain when they can't cwd to the current
directory.
hcoop-all-db-backup
patch
|
blob
|
blame
|
history
diff --git
a/hcoop-all-db-backup
b/hcoop-all-db-backup
index
a3ba510
..
d0a9a10
100755
(executable)
--- a/
hcoop-all-db-backup
+++ b/
hcoop-all-db-backup
@@
-13,6
+13,9
@@
if ! test -d "$BACKUP_ROOT"; then
exit 1
fi
+# change cwd; default will be /root which postgres user can't chdir into
+cd /tmp
+
MYSQL_DBS=`sudo -H mysql -Bse 'show databases' | xargs`
echo "Mysql Databases are: $MYSQL_DBS"
PGSQL_DBS=`sudo -u postgres psql template1 -tAc 'SELECT datname FROM pg_database WHERE datistemplate = false;' | xargs`