Linux2019. 1. 10. 11:59


-------- 서버 side -------------
#]crontab -l
00 03 * * * /var/spool/cron/backup.sh

#]cat /var/spool/cron/backup.sh
#!/bin/bash
# DB Backup
/usr/local/mysql/bin/mysqldump --opt -uUSERNAME -pPASSWD DBname > /backup/DBname_$(date +%Y%m%d).dump
######################
# COMPRESS
gzip /backup/db_*.dump
######################
#
# SOURCE Backup
tar zcf /backup/www_$(date +%Y%m%d).tar.gz /home/www


--------- 클라이언트 side -------------
#]crontab -l
00 04 * * * /backup/backup_script/ftpcron.sh

#]cat /backup/backup_script/ftpcron.sh
find /backup/serv_backup -type f -name "*.tar.gz" -mtime +1 -exec rm -f {} \;
find /backup/serv_backup -type f -name "DBname*" -mtime +1 -exec rm -f {} \;
ftp -n 211.32.149.174 1121 < /backup/backup_script/ftpscript

#]cat /backup/backup_script/ftpscript
user suil PASSWD
cd /backup/
lcd /backup/serv_backup
binary
prompt
mget *.gz
bye

'Linux' 카테고리의 다른 글

리눅스서버 설치후 보안세팅  (0) 2019.01.10
redhat 9 에서 qmail + vpopmail 설치  (0) 2019.01.10
IP 알리아스  (0) 2019.01.10
iptables로 IP, IP대역 막기  (0) 2019.01.10
CentOS6 에서 nodejs 설치  (0) 2018.02.07
Posted by requireme