LINUX_SRV Telegram 565
Bash-скрипт для выполнения дампа всех баз данных MySQL, используемых на сервере.

1- Для запуска скрипта необходимо дать права на исполнение скрипту командой chmod +x dump_all_databases.sh.
2- Запустить скрипт выполнив одну из следующих команд:
./dump_all_databases.sh
sh dump_all_databases.sh
bash dump_all_databases.sh


3- Дождататься, когда выполниться процесс. Дампы будут сохранены в формате YYYYMMDD.name_db.sql.


#!/usr/bin/env bash

databases=`mysql -e "SHOW DATABASES;" | tr -d "| " | grep -v Database`

for db in $databases; do
if [[ "$db" != "information_schema" ]] && [[ "$db" != "performance_schema" ]] && [[ "$db" != "mysql" ]] && [[ "$db" != _* ]] ; then
echo "Dumping database: $db"
mysqldump --databases $db > `date +%Y%m%d`.$db.sql
# gzip $OUTPUT/`date +%Y%m%d`.$db.sql
fi
done
2



tgoop.com/linux_srv/565
Create:
Last Update:

Bash-скрипт для выполнения дампа всех баз данных MySQL, используемых на сервере.

1- Для запуска скрипта необходимо дать права на исполнение скрипту командой chmod +x dump_all_databases.sh.
2- Запустить скрипт выполнив одну из следующих команд:
./dump_all_databases.sh
sh dump_all_databases.sh
bash dump_all_databases.sh


3- Дождататься, когда выполниться процесс. Дампы будут сохранены в формате YYYYMMDD.name_db.sql.


#!/usr/bin/env bash

databases=`mysql -e "SHOW DATABASES;" | tr -d "| " | grep -v Database`

for db in $databases; do
if [[ "$db" != "information_schema" ]] && [[ "$db" != "performance_schema" ]] && [[ "$db" != "mysql" ]] && [[ "$db" != _* ]] ; then
echo "Dumping database: $db"
mysqldump --databases $db > `date +%Y%m%d`.$db.sql
# gzip $OUTPUT/`date +%Y%m%d`.$db.sql
fi
done

BY Типичный Сисадмин


Share with your friend now:
tgoop.com/linux_srv/565

View MORE
Open in Telegram


Telegram News

Date: |

Private channels are only accessible to subscribers and don’t appear in public searches. To join a private channel, you need to receive a link from the owner (administrator). A private channel is an excellent solution for companies and teams. You can also use this type of channel to write down personal notes, reflections, etc. By the way, you can make your private channel public at any moment. Click “Save” ; The channel also called on people to turn out for illegal assemblies and listed the things that participants should bring along with them, showing prior planning was in the works for riots. The messages also incited people to hurl toxic gas bombs at police and MTR stations, he added. Today, we will address Telegram channels and how to use them for maximum benefit. In the next window, choose the type of your channel. If you want your channel to be public, you need to develop a link for it. In the screenshot below, it’s ”/catmarketing.” If your selected link is unavailable, you’ll need to suggest another option.
from us


Telegram Типичный Сисадмин
FROM American