Wednesday, October 14, 2015

Script to create SVN Project

1 => Create a file create_project.sh and copy below code and paste in file and save it

#vim create_project.sh

#!/bin/bash
black='\E[30m'
red='\E[31m'
green='\E[32m'
yellow='\E[33m'
blue='\E[34m'

echo -e "$blue Please Enter Project Name $black"
read PROJ

svnadmin create /opt/lampp/htdocs/sub/repos/$PROJ

#Change Directory according to your SVN Directory

touch /opt/lampp/htdocs/sub/repos/$PROJ/hooks/post-commit

chmod 777 /opt/lampp/htdocs/sub/repos/$PROJ/hooks/post-commit

echo -e "svn export --force file:///opt/lampp/htdocs/sub/repos/$PROJ/  /opt/lampp/htdocs/sub/web/$PROJ/" > /opt/lampp/htdocs/sub/repos/$PROJ/hooks/post-commit

sed -i '15i anon-access = none' /opt/lampp/htdocs/sub/repos/$PROJ/conf/svnserve.conf

sed -i '16i auth-access = write' /opt/lampp/htdocs/sub/repos/$PROJ/conf/svnserve.conf

sed -i '17i  password-db = passwd' /opt/lampp/htdocs/sub/repos/$PROJ/conf/svnserve.conf

echo -e "$Blue SVN project $black $green $PROJ $blue created sucessfully please allow users in "$green /opt/lampp/htdocs/sub/repos/$PROJ/conf/passwd
$blue"  to access $green $PROJ $blue Repository "
echo -e "SVN Repository URL for Project $green $PROJ $blue is given below "
echo -e "$grean svn://192.168.1.100:/opt/lampp/htdocs/sub/repos/$PROJ $black"

## Change your IP according to your Server


 Note: if you want to learn how to create SVN server use below link.

http://makelinuxinteresting.blogspot.in/2015/02/how-to-create-svn-server-and-add.html


Mastering Cron Jobs in Linux: A Comprehensive Guide with Examples

Introduction: Cron jobs are an indispensable tool in the world of system administration and automation. They allow users to schedule tasks t...