Backup Website Code、Database to Remote Server/Ftpserver Automatically
来源:互联网 发布:lurker软件怎么用 编辑:程序博客网 时间:2024/05/16 06:00
Part I backup plan and host info
A simple backup system plan
The main advantage of using FTP or NAS backup is a protection from data loss.
I am going to write about FTP backup solution here. The idea is as follows:
- Make full backup every day night
- Also we can backup only those files that has been modified since the full backup (incremental backup) as a seven-day backup cycle.
Our sample setup-this is a full backup demo
Local Server ===>>> Remote Server[ftp/nas server]
IP:192.168.1.10/192.168.1.11 ===>>> 192.168.1.12
Let us assume that your ftp details are as follows:
- FTP server IP: 192.168.1.12
- FTP Username: R_to+FTP-test
- FTP Password: Pass_$$$$
- FTP Directory: /bak (or /)
You will store data at remote server as follows:
=>> /bak/web/192.168.1.10/files mm-dd-yy - Full backup
=>> /bak/db/192.168.1.11/ files mm-dd-yy - Full backup
Local Server:Server A& Server B info
Server A :Website win2003 OS
ip:192.168.1.10
Website code path e:/website/longrujun.name
Server B :Database WIN2003+MSSQL2005
Ip:192.168.1.11
Database related info
E:/bak/Full
/Diff
/Logs
Remote Server:Server C info
Ftp server Account info win2003+Server-U
Ip:192.168.1.12
Username:R_to+FTP-test
Passwd:Pass_$$$$
Main Home Directory E:/bak
The detail architecture as the following describes
E:/bak/web:archive the ServerA’s website code
/db:archive the serverB’s database files
/logs:archive the web logs
Part II:Config
1、 backup website code to remote ftp server
A、Download the AutoRun.rar file on ServerA’s Disk F and extract
B、Open AutoRun folder and make 2 config files in run folder
web_to_remote.bat
======start====
rar a -m0 F:/Autorun/backup/10website%date:~2,2%%date:~5,2%%date:~8,2%.rar e:/website/longrujun.name
cd F:/Autorun/backup
F:
ftp -v -n -s:F:/Autorun/run/ftp10website.txt 192.168.1.12
del F:/Autorun/backup/*.rar /a /s /q /f
=======end=====
ftp10website.txt
=======start===
open 192.168.1.12
user R_to+FTP-test Pass_$$$$
cd web
cd 192.168.1.10
bin
prompt
mput *.rar
bye
========end====
Ok,now,pls add the web_to_remote.bat to scheduled task and run it a day
2、 backup database files to remote ftp server
the 2 steps as the upper ways
A、 Download the AutoRun.rar file on ServerA’s Disk F and extract
B、 Open AutoRun folder and make 2 config files in run folder
db_to_remote.bat
======start====
rar a -m0 F:/Autorun/backup/10website%date:~2,2%%date:~5,2%%date:~8,2%.rar E:/bak/Full
cd F:/Autorun/backup
F:
ftp -v -n -s:F:/Autorun/run/ftp11db.txt 192.168.1.12
del F:/Autorun/backup/*.rar /a /s /q /f
=======end=====
ftp11db.txt
=======start===
open 192.168.1.12
user R_to+FTP-test Pass_$$$$
cd db
cd 192.168.1.11
bin
prompt
mput *.rar
bye
========end====
The same as we should add the db_to_remote.bat to scheduled task and run it a day
- Backup Website Code、Database to Remote Server/Ftpserver Automatically
- Transfer postgres database to another server - backup and restore
- How to backup and restore database in SQL Server
- How Do I Enable Remote Access To MySQL Database Server?
- How to Login Automatically into Website Using Excel VBA
- Create Remote Database Server - PostgreSQL
- ALTER DATABASE BACKUP CONTROLFILE TO TRACE
- alter database backup controlfile to trace
- How To Trace The Remote File Server (RFS) Process In Physical Standby Database (Doc ID 1481125.1)
- backup database
- BACKUP DATABASE
- Move WordPress Website To New Server
- remote server ppt2003 to images
- sql server BACKUP LOG database WITH NO_LOG Clean log
- SQL SERVER BACKUP DATABASE 加快备份速度方法
- How to failover automatically in windows server 2008 failover cluster
- backup mysql database and ftp to another computer
- alter database backup controlfile to trace 文件位置
- 断网事件中Google服务正常的答复
- Sina、sohu、tom、163、baidu、google域名服务器测评
- 本周技术关注:High Performance SOA #
- DNS TSIG实现CDN+GSLB
- 本周技术关注:LINUX动态链接库高级应用 #
- Backup Website Code、Database to Remote Server/Ftpserver Automatically
- 本周技术关注:Designing Flexible and Secure Firewalls, Part I - Intel Software Network #
- 本周技术关注:Welcome to the LVS Knowledge Base #
- 本周技术关注:Advanced Linux and Unix Programming
- 本周技术关注:ISP-Server Setup - Ubuntu 5.10 'Breezy Badger' | HowtoForge - Linux Howtos and Tutorials
- 本周技术关注:Awstats、Mrtg、Webalizer How-TO Articles
- 本周技术关注:Oracle10G、MSSQL2005、MYSQL5: CLuster、Replication、Snapshot
- Database War Stories Serialization
- 本周技术关注[面向webapps运维]:从LiveJournal后台发展看大规模网站性能优化方法: 一个藏袍 #