rajeshkumar created the topic: SVN admin project to backup and restore the svn repo
Write a shell scripting using swtich case with the following options.
1. Create a repo. Repo name should be entered by user
2. Take a full dump
3. Incremental backup. user need to entered the revsion nujmber
4. Restore the dump to the location which has been entered by the user
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn
sribhavani_u replied the topic: SVN admin project to backup and restore the svn repo
#!/bin/bash
#Write a shell scripting using swtich case with the following options.
#1. Create a repo. Repo name should be entered by user
#2. Take a full dump
#3. Incremental backup. user need to enter the revision number
#4. Restore the dump to the location which has been entered by the user
while true
do
echo “1. Create a repo.”
echo “2. Take a full dump”
echo “3. Incremental backup.”
echo “4. Restore the dump”
echo “Enter a number for choosing the option:”
read num
case $num in
1) echo “repo name:”
read name
mkdir -p /usr/src/svn/$name
svnadmin create –fs-type fsfs /usr/src/svn/$name
echo “repo $name created” ;;
2) svnadmin dump /usr/src/svn/$name –revision 0:HEAD > $name.dump
echo “$name.dump file created” ;;
3) echo “give revision number”
read rev
svnadmin dump /usr/src/svn/$name –revision $rev:HEAD –incremental > $name-$rev.dump
echo “incremental dump done” ;;
4) echo “give the location to where the dump should be restored”
read loc
svnadmin load $loc < $name.dump
echo "dump restored" ;;
*) echo "INVALID OPTION"
exit ;;
esac
done
rajeshkumar replied the topic: SVN admin project to backup and restore the svn repo
#!/bin/bash
#Write a shell scripting using swtich case with the following options.
#1. Create a repo. Repo name should be entered by user
#2. Take a full dump
#3. Incremental backup. user need to enter the revision number
#4. Restore the dump to the location which has been entered by the user
while true
do
echo “1. Create a repo.”
echo “2. Take a full dump”
echo “3. Incremental backup.”
echo “4. Restore the dump”
echo “Enter a number for choosing the option:”
read num
case $num in
1) echo “repo name:”
read name
mkdir -p /usr/src/svn/$name
svnadmin create –fs-type fsfs /usr/src/svn/$name
echo “repo $name created” ;;
2) svnadmin dump /usr/src/svn/$name –revision 0:HEAD > $name.dump
echo “$name.dump file created” ;;
3) echo “give revision number”
read rev
svnadmin dump /usr/src/svn/$name –revision $rev:HEAD –incremental > $name-$rev.dump
echo “incremental dump done” ;;
4) echo “give the location to where the dump should be restored”
read loc
svnadmin load $loc < $name.dump
echo "dump restored" ;;
*) echo "INVALID OPTION"
exit ;;
esac
done
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn
- Use of runtime variables to save into another variable using register in Ansible - September 6, 2018
- Ansible & Ansible Tower Variable Precedence Hierarchy - September 6, 2018
- How to use template in Ansible? - September 6, 2018