Answer the question
In order to leave comments, you need to log in
How to change the backup mysql script to Yandex.Disk?
In the question , mureevms suggested a script to backup the database to YandexDisk.
I need to make the backups of different databases be separate files.
Suggested script:
#!/bin/sh
TIME=`date +%Y-%m-%d`
# Логин пользователя мускула
USER=root
# Пароль пользователя мускула
PASS=root_password
WHERE=/home/backup/mysql
COPY=/mnt/yadisk/mysql
### Базы которые надо бэкапить
for base in base_name1 base_name2
do
# Сделать дамп баз
mysqldump -u$USER -p$PASS -B $base > $WHERE/$base-$TIME.sql
done
cp $WHERE/$base-$TIME.sql $COPY
find $WHERE -mtime +1 -print -delete
find $COPY -mtime +30 -print -delete
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question