I. Implementing SSH remote Login
Machine Environment:
192.167.33.108 clent User: Crawler
192.167.33.77 Server User: Crawler
1. Client- generated key
/home/crawler/.ssh/ssh-keygen
2. View Key file permissions
Ls-ld ~/.ssh; Ls-l ~/.ssh
3. Modify File Permissions
chmod 700/home/crawler/.ssh
chmod 600/home/crawler/. SSH/id_rsa
4. Copy the public key to the server side
Scp-r /home/crawler/. SSH/id_rsa.pub [email protected]:/home/crawler/. SSH
5. Setting the public key on the server side
Need to be drwx
Ls-l/home/crawler/.ssh/*pub See if there is a public key
/home/crawler/.ssh/authorized_keys//Generate public key It's best to avoid replacing the previous public key in this way
/home/crawler/.ssh/authorized_keys//Modify Permissions
/HOME/CRAWLER/.SSH//View permissions
6.ssh [email protected] Login successful
Second, backup MySQL database
1. Backup script (start Backup daily 3 o'clock in the morning 30, keep only 7 days of backup data)
* * * * * sh/home/crawler/mysql_back_up/script/mysql-backup.sh GQUAN_MISS8
rq= ' Date +%y%m%d '
Echo backuping $
mysqldump-uroot-p111111--default-character-set=utf8--opt--triggers-r--hex-blob--single-transaction $ | gzip >/home/crawler/mysql_back_up/daily/$1-all-$RQ. sql.gz
Find/home/crawler/mysql_back_up/daily-mtime +7-name "*.sql.gz"-exec rm-rf {} \;
Echo Finished backup $
2.rsync incremental synchronization of remote backup data (performed 5:10 A.M. daily)
* * * * * sh/home/crawler/mysql_back_up/script/back_mysql_77.sh >>/home/crawler/mysql_back_up/script/ Back.log
#!/bin/sh
echo "------------------------start--------------" ' Date '
Rsync-au--delete/home/crawler/mysql_back_up/daily/[Email protected]:/home/crawler/back_96_data
echo "------------------------over--------------" ' Date
3. Test View server with client file description correct
Server pictures
Client pictures
MySQL database backup and remote copy implementation