LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-04-2015, 12:58 AM   #1
Kanimozhi_Mayilsamy
LQ Newbie
 
Registered: Aug 2015
Posts: 3

Rep: Reputation: Disabled
How to get Latest revison number from svn using shell scripts


Hello all,

Very good morning.I am new to this site.

I am badly need an immediate help regarding one requirement.Here you go.

1.Need to fetch latest subversion revison numbers from svn.
svn url is http://****.svn.mhf.mhc/svn/sbb/sbb/trunk
2.Take a back up of all those codes in a temporary folder.
3.Create a new directory and copy the latest code.
4.Everything should be done using shell scripts on linux/unix server.

Can anyone help me on this?

Regards,
Kani
 
Old 08-04-2015, 02:12 AM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,241

Rep: Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322
Quote:
Originally Posted by Kanimozhi_Mayilsamy View Post
1.Need to fetch latest subversion revison numbers from svn.
svn url is http://****.svn.mhf.mhc/svn/sbb/sbb/trunk
This gets you the revision number of the trunk:

Code:
svn info http://****.svn.mhf.mhc/svn/sbb/sbb/trunk | grep "Last Changed Rev:" | rev | cut -d ' ' -f 1
You can capture that into a variable like this:

Code:
VERSION=$(svn info http://****.svn.mhf.mhc/svn/sbb/sbb/trunk | grep "Last Changed Rev:" | rev | cut -d ' ' -f 1)

Last edited by dugan; 08-04-2015 at 02:24 AM.
 
Old 08-04-2015, 03:57 AM   #3
Kanimozhi_Mayilsamy
LQ Newbie
 
Registered: Aug 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
take a backup

Many thanks for ur help.

I need to take a back up of latest revision code into a temp folder which is already exists.
If that temp folder is not available already then the command itself should create the folder and take a back up of latest code.

Can you please help me withe the above task?

regards
kani






Quote:
Originally Posted by dugan View Post
This gets you the revision number of the trunk:

Code:
svn info http://****.svn.mhf.mhc/svn/sbb/sbb/trunk | grep "Last Changed Rev:" | rev | cut -d ' ' -f 1
You can capture that into a variable like this:

Code:
VERSION=$(svn info http://****.svn.mhf.mhc/svn/sbb/sbb/trunk | grep "Last Changed Rev:" | rev | cut -d ' ' -f 1)
 
Old 08-04-2015, 08:53 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,008

Rep: Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193
It could just be me, but wouldn't that be at least 4 requirements?

Also, 'immediate' help comes when you pay someone. Please try not to demand help as this is done voluntarily.
 
Old 08-05-2015, 04:26 AM   #5
Kanimozhi_Mayilsamy
LQ Newbie
 
Registered: Aug 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Dugan ,

It is saying that svn is not a commman in bash scripts.


Quote:
Originally Posted by Kanimozhi_Mayilsamy View Post
Many thanks for ur help.

I need to take a back up of latest revision code into a temp folder which is already exists.
If that temp folder is not available already then the command itself should create the folder and take a back up of latest code.

Can you please help me withe the above task?

regards
kani
 
Old 08-05-2015, 05:21 AM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,008

Rep: Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193
You will need to check that svn is installed on your machine and remedy if not. As for the other steps in your requirement, first show your attempt at a solution and we will further assist in a solution.


No one is going to do the work (perhaps homework) for you.
 
  


Reply

Tags
shell scripting



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Issue with SVN and the latest Openssl in 14.0 x64 D1ver Slackware 5 02-12-2013 03:48 AM
SVN in shell scripts - automating passwords Bfkhiya Linux - Software 3 10-01-2011 09:41 AM
How to match number range in shell scripts? qcmao Programming 9 08-30-2011 03:04 AM
svn checkout by revision number prayag_pjs Linux - Newbie 2 11-03-2009 07:44 AM
how can i run a shell scripts (or a number of commands )when a user logs in to a linu rddreamz Programming 4 05-20-2004 03:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration