In order to ensure the recoverability of the data in the server, a remote backup database scheme is used. Offsite backup data are divided into off-site backup file data and off-site backup database data two kinds. The off-site backup file data is designed to back up files uploaded by users in the site. and offsite backup database data is the database of data backup files uploaded to the remote server.
If you can use some software such as Green loop FTP data backup, rsync can be.
First, the implementation process and principles are:
1. Need to install WinRAR software, used to compress multiple files to be backed up into a compressed file.
2. Write back steps:
Directory is located under the WinRAR Software installation path
cd C:\Program Files\winrar
Execute Rar.exe Program
RAR a-r-y c:\c.rar c:\c\a c:\c\b
Connect to a remote FTP server where you want to write ftp://ftp.txt/files
Ftp-s:c:\ftp.txt 192.168.0.1
Can delete local backup files
del/f/q C:\c.rar
Catalog Relocation
cd\
The complete code is as follows (Back.bat):
Copy Code code as follows:
cd C:\Program Files\winrar
RAR a-r-y c:\c.rar c:\c\a c:\c\b
Ftp-s:c:\ftp.txt 192.168.0.1
del/f/q C:\c.rar
cd\
3. Write the remote FTP connection configuration file
User name
Password
CD path
Put local file path and filename remote file path and filename
Bye for exit
The complete code is as follows (Ftp.txt):
Admin
Heroic
Put C:\c.rar C.rar
Bye
4. Run the bat file regularly with the "Scheduled Tasks" feature of Windows. (by "Start"-> "-> System Tools"-> "Task Scheduler")
5. Backup Oracle database commands are:
Exp userid/pwd@servicename file = "Backupfilepath" owner = user
Note UserID for the system administrator, backupfilepath the file save path (file suffix is dmp), user is a backup for that users, if not write this parameter, the default for UserID users to backup
For example:
Exp user/pwd@servername file=d: "Backup Oracle" ORACLE%DATE:~0,10%.DMP owner=system log=d: "Backup Oracle" Oracle%date : ~0,10%.log
(where%date:~0,10% is to take the current system time.) 0 is start position, 10 is end position)
Copy Code code as follows:
Set Files=c:\backup\%date:~0,10%.rar
Set Dbfilesdmp=c:\backup\%date:~0,10%db.dmp
Set userdb= "Jbpmdemo"
Set pwddb= "Jbpmdemo"
Set domain= "Master.jhserver"
Set Filespath=c:\c\a c:\c\b
Set ftpfile= "C:\backup\ftp.txt"
Set Ftpname=admin
Set Ftppwd=heroic
Set ftpfiles= "%date:~0,10%.rar"
Set ftpdbfiles= "%date:~0,10%db.rar"
Set ftpdomain= "192.168.0.1"
Set rarpath= "C:\Program Files\winrar"
@echo start backing up the database
Exp%userdb%/%pwddb%@%domain% file= "%dbfilesdmp%"
@echo Start compressing files
C:
cd C:\Program Files\winrar
RAR a-r-y%files%%filespath%%dbfilesdmp%
@echo Write File ftp
@echo%ftpname%>%ftpfile%
@echo%ftppwd%>>%ftpfile%
@echo put%files%%ftpfiles%>>%ftpfile%
@echo bye>>%ftpfile%
@echo Upload%files%.rar file
Ftp-s:%ftpfile% 192.168.0.1
del/f/q%files%