Back up the code uploaded by svn in Ubuntu and name the backup file svn_backup + current time. dump File (for example, svn_backup20100525.dump) 1. write a script file (backup. sh) sudotouchbackup. sh create a script file and edit the file sudovimbackup. sh is the content of the configuration file. The Code is as follows :#! /Bin/shsudosvnadmin
Back up the svn upload code in Ubuntu and name the backup file svn_backup + current time. dump (for example, svn_backup20100525.dump)
1. Write a script file (backup. sh)
Sudo touch backup. sh
Create a script file and edit the file
Sudo vim backup. sh
The Code is as follows:
#! /Bin/sh
Sudo svnadmin dump/srv/svn/repos/works>/home/jordy/svn_back_up $ (date + % Y % m % d). dump
Echo success!
Back up the code under the/srv/svn/repos/works directory to the/home/jordy/directory. The file name is
Svn_backup + current time. dump File. The last sentence only prompts that the backup is successful and can be deleted.
Use commands
Sh-x backup. sh
Test whether the script is successful.
After the preceding script file is compiled, run the following scheduled task:
Sudo vim/etc/crontab
The last line in the code, where:
Indicates the backup time. Fill in the data according to m h dom mon dow and execute the data every minute during my test.
Backup. sh script file.
After the operation is complete, you can go to the corresponding directory to check whether the backup file is generated.