initial commit of file from CVS for smeserver-postgresql on Sat Sep 7 20:54:55 AEST 2024
This commit is contained in:
5
root/etc/e-smith/events/actions/pgsql-delete-db-files
Normal file
5
root/etc/e-smith/events/actions/pgsql-delete-db-files
Normal file
@@ -0,0 +1,5 @@
|
||||
#! /bin/sh
|
||||
|
||||
cd /var/lib/pgsql/13 && \
|
||||
find . -type f | xargs rm -f && \
|
||||
rm -rf data/*
|
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec /bin/rm -f /home/e-smith/db/pgsql/pgsql.dump
|
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