Svnserver scheduled backup summary in Linux:
This article is mainly combined with the previous about the "Linux build svnserver Summary", to explain how to backup Svnserver under Linux, to prevent the individual situation caused by the serious consequences of data loss.
The implementation process is basically: we need to create a new backup SH script and then run the previous script using Contab. And the success of the simulation verification, it is still relatively simple.
Ps:
As for the specific introduction of Contab will be listed in the summary. Just click here to do this.
"Linux Build Svnserver Summary" address:
http://blog.csdn.net/why_2012_gogo/article/details/47361497
· SH Backup script
· Timed Run SH
· Analog Run SH
1. Sh Backup script
Create a backup folder
#mkdir/opt/project_backup
Edit Backup Script
#cd/HOME/SVN
#vim project_backup.sh
The script contents are as follows:
Cd/home/svn
now= '/bin/date +%y%m%d '
/bin/tar czvf "project_backup_$now.tar.gz" project/&& rm-rf/opt/project_backup/* &&/bin/mv projec t_backup_*.tar.gz/opt/project_backup/
If[$?==0]
Then
result= "OK"
Else
result= "Fail"
Fi
For example, the following:
Note:
Now: Call the date function. Generate the following required date to prepare for the file name word;
/bin/tar: Package A backup, delete the old backup, and move the new backup.
2. Timed Operation SH
#contab-E
Type the content:
0 ***/home/svn/project_backup.sh
Note:
0 24: Run this backup script on behalf of 24 points per day
The results are as follows:
3. Analog Run SH
#./home/svn/project_backup.sh
#cd/opt/project_backup
To view the backup:
Technical Discussion Group (new):
182437336
Summary of SVN scheduled backups in Linux