Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- user="root";
- password="xxx";
- #Sprawdzamy czy macierz sie pinga
- ping 10.10.0.100 -c 5
- if [ "$?" != 0 ]; then
- exit 2;
- else
- #Probujemy zamontowac
- mount -vvvv 10.10.0.100:/mnt/storage/back-mysql /mnt/mysql-backup/ -o nolock
- #Jesli sie nie udalo, konczymy.
- if [ "$?" != "0" ]; then
- exit 2;
- fi
- date1=`date +%F`
- mkdir /mnt/mysql-backup/$date1
- date=`date +"%F-%H-%M"`
- echo -n "Backup lms...."
- mysqldump -u${user} -p${password} lms > /mnt/mysql-backup/$date1/lms.sql.$date
- echo -en "\y [ DONE ]";
- echo
- gzip -9 -r /mnt/mysql-backup/*
- umount /mnt/mysql-backup/
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement