home
·
contact
·
privacy
projects
/
config
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Extend Pleroma-from-source scripting.
[config]
/
buster
/
setup_scripts
/
backup_app.sh
diff --git
a/buster/setup_scripts/backup_app.sh
b/buster/setup_scripts/backup_app.sh
index e3f22e43f70bed78f519f9d0cda6193d325f339b..9b37b141c3306548bb750cf42a569c16d1c5e6da 100755
(executable)
--- a/
buster/setup_scripts/backup_app.sh
+++ b/
buster/setup_scripts/backup_app.sh
@@
-4,7
+4,6
@@
set -x
if [ "$#" -lt 3 ]; then
echo 'Need at least three arguments: service name, DB name, and backup directory names.'
if [ "$#" -lt 3 ]; then
echo 'Need at least three arguments: service name, DB name, and backup directory names.'
- #echo 'Need at least two arguments: service name and backup directory or (prefixed with "db:") DB names.'
false
fi
app="$1"
false
fi
app="$1"
@@
-12,22
+11,17
@@
db_name="$2"
shift 2
cd /tmp
shift 2
cd /tmp
-rm -rf "/tmp/${app}_backup"
+rm -rf "${app}_backup"
+mkdir "${app}_backup"
+chmod 777 "${app}_backup"
service "${app}" stop
service "${app}" stop
-su postgres -lc "pg_dump -d ${db_name} --format=custom -f
${app}_backup/
pgdump"
+su postgres -lc "pg_dump -d ${db_name} --format=custom -f
/tmp/${app}_backup/${db_name}.
pgdump"
for target in "$@"; do
for target in "$@"; do
+ mkdir -p $(dirname "${app}_backup${target}")
cp -a "${target}" "${app}_backup${target}"
done
cp -a "${target}" "${app}_backup${target}"
done
-#for target in "$@"; do
-# prefix=$(echo "${target}" | cut -c-3)
-# if [ "${prefix}" = "DB:" ]; then
-# db_name=$(echo "${ŧarget}" | cut -c4-)
-# else
-# cp -a "${target}" "backup${target}"
-# fi
-#done
tar cf "${app}_backup.tar" "${app}_backup"
rm -rf "${app}_backup"
tar cf "${app}_backup.tar" "${app}_backup"
rm -rf "${app}_backup"