(root)//trunk/runutils/sd/testschemeshop2020.sh – Rev 29000 → 29002
Rev 29000 |
Go to most recent revision |
Show entire file |
Ignore whitespace |
Details |
Blame |
Last modification |
View Log
| RSS feed
| Rev 29000 |
Rev 29002 |
| Line 1... |
Line 1... |
| 1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
| 2 |
BACKUP_DIR=/root/.backup/daily
|
2 |
BACKUP_DIR=/root/.backup/daily
|
| 3 |
SERVER=192.168.190.112
|
3 |
SERVER=192.168.190.112
|
| 4 |
BACKUP_FILE=$(sshpass -p shop2020 ssh $SERVER 'ls -t /root/.backup/daily | head -1')
|
4 |
BACKUP_FILE=$(sshpass -p shop2020 ssh $SERVER 'ls -t /root/.backup/daily | head -1')
|
| 5 |
sshpass -p shop2020 scp $SERVER:$BACKUP_DIR/$BACKUP_FILE .
|
5 |
sshpass -p shop2020 scp $SERVER:$BACKUP_DIR/$BACKUP_FILE .
|
| 6 |
gunzip -f ./$BACKUP_FILE
|
- |
|
| 7 |
|
6 |
gunzip -f ./$BACKUP_FILE dump.sql
|
| - |
|
7 |
mysql -uroot -pshop2020 < dump.sql
|
| - |
|
8 |
|
| 8 |
|
9 |
|