You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGES
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,3 +3,4 @@ EDIT 1.0 - 28.12.2017: ignore template databases while backing up
3
3
EDIT 1.0 - 30.12.2017: ignore databases disallowing connections and include template databases while backing up
4
4
EDIT 1.0 - 02.01.2018: changed the path looking for psql and pg_dump commands
5
5
EDIT 1.1 - 22.04.2018: added server-, port- and searchfolders-configuration in configfile, added example with default values for configfile
6
+
EDIT 1.1 - 23.04.2018: added possibility to specify sharetype (smb:qnap or filesystem), configuration file to use can be passed as first parameter to script
server=$(/sbin/getcfg pgsqlbackup server -f "$config")
55
+
port=$(/sbin/getcfg pgsqlbackup port -f "$config")
56
+
49
57
# Internal variable setup
50
58
arc=$($date_c +%y%m%d).tar.gz
51
59
dest=
@@ -129,17 +137,29 @@ if [[ -z "$day_ret" ]] ; then day_ret="6" ; warn "days to keep backup not set in
129
137
if [[ -z"$week_ret" ]] ;then week_ret="5"; warn "weeks to keep backup not set in config, setting to 5";fi
130
138
if [[ -z"$month_ret" ]] ;then month_ret="3"; warn "months to keep backup not set in config, setting to 3";fi
131
139
if [[ -z"$weekday_rot" ]] ;then weekday_rot="0"; warn "weekly rotate day not set in config, setting to sunday";fi
132
-
if [[ -z"$share" ]] ;then share="Backup"; warn "share for storing Backup not set in config, setting to Backup";fi
140
+
if [[ -z"$share" ]] ;then share="Backup"; warn "share for storing backup not set in config, setting to Backup";fi
141
+
if [[ -z"$sharetype" ]] ;then sharetype="smb:qnap"; info "sharetype for storing backup not set in config, setting to smb:qnap";fi
133
142
if [[ -z"$user" ]] ;then user="User"; warn "PostgreSQL user for backup not set in config, setting to User";fi
134
143
if [[ -z"$pw" ]] ;then pw="Password"; warn "PostgreSQL password for backup not set in config, setting to Password";fi
135
144
if [[ -z"$searchfolders" ]] ;then searchfolders="/share/CACHEDEV1_DATA/.qpkg/PostgreSQL /share/CACHEDEV1_DATA/.qpkg/Optware"; info "PostgreSQL searchfolders for backup not set in config, setting
136
145
to default for Qnap";fi
137
146
if [[ -z"$server" ]] ;then server="127.0.0.1"; info "PostgreSQL server for backup not set in config, setting to 127.0.0.1";fi
138
147
if [[ -z"$port" ]] ;then port="5432"; info "PostgreSQL server port for backup not set in config, setting to 5432";fi
0 commit comments