Update backup.sh
This commit is contained in:
parent
346aa10822
commit
5782e0826b
1 changed files with 8 additions and 8 deletions
16
backup.sh
16
backup.sh
|
@ -13,19 +13,14 @@ NUM_CORES=$(nproc || echo 1)
|
||||||
# Author : Mark Schenk <info@foxly.de> #
|
# Author : Mark Schenk <info@foxly.de> #
|
||||||
# Date : 2021-10-06 08:32 #
|
# Date : 2021-10-06 08:32 #
|
||||||
# License : MIT #
|
# License : MIT #
|
||||||
# Version : 1.1 #
|
# Version : 1.2 #
|
||||||
# #
|
# #
|
||||||
# Usage : bash ./backup.sh #
|
# Usage : bash ./backup.sh #
|
||||||
echo "" #
|
|
||||||
echo " Detected OS : $OS_DISTRO" #
|
|
||||||
echo " Detected Arch : $OS_ARCH" #
|
|
||||||
echo " Detected Cores : $NUM_CORES" #
|
|
||||||
echo "" #
|
|
||||||
##############################################################
|
##############################################################
|
||||||
####################
|
####################
|
||||||
# Helper functions #
|
# Helper functions #
|
||||||
####################
|
####################
|
||||||
backup_VER="v1.1"
|
backup_VER="v1.2"
|
||||||
|
|
||||||
str_repeat() {
|
str_repeat() {
|
||||||
printf -v v "%-*s" "$1" ""
|
printf -v v "%-*s" "$1" ""
|
||||||
|
@ -94,6 +89,11 @@ echo " $WELCOME_TXT"
|
||||||
echo " $(str_repeat "$WELCOME_FEN" "#")"
|
echo " $(str_repeat "$WELCOME_FEN" "#")"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo " Detected OS : $OS_DISTRO"
|
||||||
|
echo " Detected Arch : $OS_ARCH"
|
||||||
|
echo " Detected Cores : $NUM_CORES"
|
||||||
|
echo ""
|
||||||
#######################
|
#######################
|
||||||
# TODO / Variables #
|
# TODO / Variables #
|
||||||
#######################
|
#######################
|
||||||
|
@ -129,7 +129,7 @@ backupRepo="/path/to/Repo"
|
||||||
# PostgreSQL #
|
# PostgreSQL #
|
||||||
#########################################################################################################################################################################
|
#########################################################################################################################################################################
|
||||||
# Optional only for PostgreSQL databases that are not stored in CloudPanel. #
|
# Optional only for PostgreSQL databases that are not stored in CloudPanel. #
|
||||||
echo -e "\e[93mcreate database backups" #
|
echo -e "\e[93mCreate database backup" #
|
||||||
databases="DATABASENAME" #
|
databases="DATABASENAME" #
|
||||||
postbackupdir="/home/cloudpanel/backups" #
|
postbackupdir="/home/cloudpanel/backups" #
|
||||||
sudo -u postgres pg_dump $databases > $postbackupdir/BBNC-$(date +%d-%m-%Y_%H-%M-%S).sql #
|
sudo -u postgres pg_dump $databases > $postbackupdir/BBNC-$(date +%d-%m-%Y_%H-%M-%S).sql #
|
||||||
|
|
Loading…
Reference in a new issue