Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Can I create a snapshot using an alias from the command line?

From the command line in RTC 4.0.4 in a Windows batch can I create a snapshot using an alias?
For instance this does not work:
scm login -r https://site:port/ccm -n RTC_ALIAS -u User -P %BuildSvcPass% -c
scm create snapshot RTC_ALIAS
The login succeeds, but the create snapshot doesn't.  It may be that I've misunderstood the syntax, what have I got wrong!?

0 votes



3 answers

Permanent link
By trial and error I found an answer, thanks also to both who replied with suggestions:
scm login -r https://site:port/ccm -n RTC_ALIAS -u User -P %BuildSvcPass% -c
scm create snapshot -r https://site:port/ccm "workspace_name"
It was not clear why I need to specify the URI again even though I have already logged on!  Other switches can be added to give the snapshot a name and description.

0 votes

Comments

At any point of time, you could be logged into multiple repositories. And, different repositories may have workspaces by the same name. So, URI is required.
Here is an example to give name to a snapshot
scm create snapshot -r https://site:port/ccm "workspace_name"  -n snapshot_name


Permanent link
The related Help topic is here http://pic.dhe.ibm.com/infocenter/clmhelp/v4r0m4/topic/com.ibm.team.scm.doc/topics/create_snapshot.html

0 votes


Permanent link
Snapshot could be created using the alias.

scm create snapshot ALIAS

Here, the ALIAS of the repository workspace should be specified.

In RTC 4.0.5, the syntax is

scm create snapshot --  ALIAS

Here, the ALIAS of the repository workspace should be specified..


0 votes

Comments

Thanks Karthik.  Does this mean that the login alias in my command line example is incorrect?  How do I get a 'repository workspace' alias?

Run the following command from within the sandbox.
scm status

The result of the above command would look like
Workspace: (1000) "TestWorkspace" <-> (1001) "Stream"
  Component: (1002) "abc1"
    ....


Here, 1000 is the alias of the repository workspace.
Now,
scm create snapshot 1000

would create the snapshot.

Thanks again.  Unfortunately I am running this from a windows batch command, not the command line.  I do not have a command output interpreter available.  Can a snapshot be created using only information available from within a Windows batch?

Snapshot could be created if the name or uuid  of repository workspace is known.
It could be done in the following way:

scm create snapshot name(or uuid) -r repository-uri

I'm sorry I am very new to RTC. Do you have a working example please?  What does the 'name' look like?  As this is part of the nightly build process, should I be taking a snapshot of the stream?

The 'name' is the  name of the repository workspace. It is the  name which is specified by the user while creating the repository workspace.

A snapshot could be created for a repository workspace.

Taking the same example given above,
scm status

The result of the above command would look like
Workspace: (1000) "TestWorkspace" <-> (1001) "Stream"
  Component: (1002) "abc1"
    ....
Now, a stream could be created for "TestWorkspace"  using (eg)

scm create snapshot TestWorkspace -r https://site:port/ccm

No need to run the status command if the name of workspace is known.

I'm sorry. In the above comment what I meant was
A snapshot could be created for "TestWorkspace" using scm create snapshot but not stream.




 

showing 5 of 7 show 2 more comments

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,017
× 1,381
× 1,202
× 158

Question asked: Jan 24 '14, 3:40 p.m.

Question was seen: 6,627 times

Last updated: Feb 04 '14, 6:28 p.m.

Confirmation Cancel Confirm