More actions
imported>neocoin No edit summary |
imported>neocoin No edit summary |
||
| Line 11: | Line 11: | ||
** http://docs.python.org/library/ftplib.html | ** http://docs.python.org/library/ftplib.html | ||
** (./) 작은 파일 하나를 zeropage@neocoin.net 으로 올린다. | ** (./) 작은 파일 하나를 zeropage@neocoin.net 으로 올린다. | ||
#!/usr/bin/python | |||
def uploadFile(filename): | |||
import ftplib | |||
s = ftplib.FTP('neocoin.net') | |||
s.login('server',password) # Connect | |||
f = open(filename,'rb') # file to send | |||
s.storbinary('STOR %s'%filename, f) # Send the file | |||
f.close() # Close file and FTP | |||
s.quit() | |||
uploadFile('index.html') | |||
# 백업 스크립트 작성 | # 백업 스크립트 작성 | ||
** backup target 설정 | ** backup target 설정 | ||
Revision as of 06:28, 3 November 2008
Pre Process
사전 공부
Process
- screen 공유를 위한 서버 세팅
- (./) http://www.pixelbeat.org/docs/screen/
- (./) sudo 권한 설정
- 언어 선택
- (./) Python
- 해당 언어로 ftp접속
- http://docs.python.org/library/ftplib.html
- (./) 작은 파일 하나를 zeropage@neocoin.net 으로 올린다.
#!/usr/bin/python
def uploadFile(filename):
import ftplib
s = ftplib.FTP('neocoin.net')
s.login('server',password) # Connect
f = open(filename,'rb') # file to send
s.storbinary('STOR %s'%filename, f) # Send the file
f.close() # Close file and FTP
s.quit()
uploadFile('index.html')
- 백업 스크립트 작성
- backup target 설정
- mysql
/usr/bin/mysqldump -u <username> -p <password> <databasename> | gzip > /path/to/backup/db/zeropage_`date +%y_%m_%d`.gz
- 복사
- 압축
- 암호화
- 전송 테스트
- 백업 정책 결정
- 주기, 시각
- cron test
11 5 * * * /root/backupToNeocoin.py >> /var/log/backupToNeocoin.log 2>&1
- 적용
Post Process
- 모니터링