Skip to content

Commit

Permalink
2.0.9
Browse files Browse the repository at this point in the history
* backup.sh now distributes archives to user folders
* added explanations for SSH keys
* added explanations when installing PHP
* fixed ydcmd working with newer versions of python
* changed mariadb installation script. Now it does not depend on blocking by Ukrainian providers.
  • Loading branch information
progreccor committed May 1, 2024
1 parent 40ae9db commit 2deede9
Show file tree
Hide file tree
Showing 6 changed files with 995 additions and 42 deletions.
13 changes: 7 additions & 6 deletions backup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
clear

MYSQLPASS="2"
if [[ -x "/usr/bin/ydcmd" ]]; then
ydcmd_path="/usr/bin/ydcmd"
elif [[ -x "/usr/local/bin/ydcmd" ]]; then
Expand Down Expand Up @@ -103,14 +103,15 @@ backupall() {
#/usr/bin/ydcmd --config=$cnf --quiet mkdir disk:/backup"$server"/"$DATE"

while read line;do
mkdir -p $DIR_BACKUP/$server/$DATE/
IFS=";"
IFS=";"
set -- $line
USER=$1
USER=$1
SITE=$2
DB=$3
DB_USER=$4
DB_PASSWD=$5

mkdir -p $DIR_BACKUP/$server/$USER/$DATE/
echo -e -n "Архивация ${GREEN}"$SITE"${WHITE}. "
FILE_NAME=$DIR_BACKUP/"$SITE".tar.gz
cd "/var/www/${USER}/www"
Expand All @@ -119,13 +120,13 @@ backupall() {
echo -n " Базы нет. "
echo -e "Идет создание архива сайта"
echo
tar -czf - $SITE --record-size=$recordsize --checkpoint=$checkpoint --checkpoint-action=exec='echo -e "\033[1A"$TAR_CHECKPOINT"mB">&2' | split -b $splitarchive --numeric-suffix - $DIR_BACKUP/"${server}/${DATE}/${SITE}.tar.gz-part-"
tar -czf - $SITE --record-size=$recordsize --checkpoint=$checkpoint --checkpoint-action=exec='echo -e "\033[1A"$TAR_CHECKPOINT"mB">&2' | split -b $splitarchive --numeric-suffix - $DIR_BACKUP/"${server}/${USER}/${DATE}/${SITE}.tar.gz-part-"
else
mysqldump -u$DB_USER -p$DB_PASSWD $DB > $DB.sql
echo -e -n " База ${GREEN}$DB${WHITE} создана. "
echo -e "Идет создание архива сайта"
echo
tar -czf - $SITE $DB.sql --record-size=$recordsize --checkpoint=$checkpoint --checkpoint-action=exec='echo -e "\033[1A"$TAR_CHECKPOINT"mB">&2' | split -b $splitarchive --numeric-suffix - $DIR_BACKUP/"${server}/${DATE}/${SITE}.tar.gz-part-"
tar -czf - $SITE $DB.sql --record-size=$recordsize --checkpoint=$checkpoint --checkpoint-action=exec='echo -e "\033[1A"$TAR_CHECKPOINT"mB">&2' | split -b $splitarchive --numeric-suffix - $DIR_BACKUP/"${server}/${USER}/${DATE}/${SITE}.tar.gz-part-"
rm ./$DB.sql
fi
echo -e "\033[1AАрхив сайта создан. Передаем на место хранения."
Expand Down
36 changes: 2 additions & 34 deletions mariadb_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,8 @@ mariadb_install() {
fi
echo -e "Выбрана версия ${GREEN}${Maria_Version}${WHITE}"

if [[ ${CURRENT_OS} =~ "Fedora" ]]; then
{
echo "# MariaDB 10.11 Fedora repository list - created 2023-03-19 15:47 UTC"
echo "# https://mariadb.org/download/"
echo "[mariadb]"
echo "name = MariaDB"
echo "baseurl = https://rpm.mariadb.org/${Maria_Version}/fedora/\$releasever/\$basearch"
echo "gpgkey= https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB"
echo "gpgcheck=1"
} >MariaDB.repo
elif [[ ${OS_VERSION} == "8" ]]; then
{
echo "# MariaDB 10.11 RedHatEnterpriseLinux repository list - created 2023-03-19 16:07 UTC"
echo "# https://mariadb.org/download/"
echo "[mariadb]"
echo "name = MariaDB"
echo "# rpm.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details."
echo "baseurl = https://rpm.mariadb.org/${Maria_Version}/rhel/\$releasever/\$basearch"
echo "module_hotfixes = 1"
echo "gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB"
echo "gpgcheck = 1"
} >MariaDB.repo
else
{
echo "# MariaDB 10.11 RedHatEnterpriseLinux repository list - created 2023-03-19 16:07 UTC"
echo "# https://mariadb.org/download/"
echo "[mariadb]"
echo "name = MariaDB"
echo "# rpm.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details."
echo "baseurl = https://rpm.mariadb.org/${Maria_Version}/rhel/\$releasever/\$basearch"
echo "gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB"
echo "gpgcheck = 1"
} >MariaDB.repo
fi
bash /root/rish/mariadb_repo_setup.sh --mariadb-server-version=${Maria_Version}

Install "MariaDB-server MariaDB-client"
systemctl start mariadb
systemctl enable mariadb
Expand Down
Loading

0 comments on commit 2deede9

Please sign in to comment.