initial commit of file from CVS for smeserver-postgresql on Sat Sep 7 20:54:55 AEST 2024
This commit is contained in:
15
root/etc/e-smith/events/actions/pgsql-dump-tables
Normal file
15
root/etc/e-smith/events/actions/pgsql-dump-tables
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
status=$(/sbin/e-smith/config getprop postgresql status)
|
||||
if [ "$status" = "disabled" ]
|
||||
then
|
||||
echo "postgresql is disabled - no tables dumped" >&2
|
||||
exit 0
|
||||
fi
|
||||
pgdumpall="/usr/pgsql-13/bin/pg_dumpall"
|
||||
#avoid error could not change directory to
|
||||
cd /tmp
|
||||
umask 027
|
||||
exec >/home/e-smith/db/pgsql/pgsql.dump
|
||||
chgrp postgres /home/e-smith/db/pgsql/pgsql.dump
|
||||
exec chpst -u postgres $pgdumpall
|
Reference in New Issue
Block a user