find list of files not modified for last 30 days in clearcase
up vote
2
down vote
favorite
I need to find list of files which are not modified for last 30 days. This means there should be no version of the file under any branch in last 30 days. is this possible in base clearcase?
find clearcase
add a comment |
up vote
2
down vote
favorite
I need to find list of files which are not modified for last 30 days. This means there should be no version of the file under any branch in last 30 days. is this possible in base clearcase?
find clearcase
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I need to find list of files which are not modified for last 30 days. This means there should be no version of the file under any branch in last 30 days. is this possible in base clearcase?
find clearcase
I need to find list of files which are not modified for last 30 days. This means there should be no version of the file under any branch in last 30 days. is this possible in base clearcase?
find clearcase
find clearcase
edited Nov 22 at 14:01
Sneftel
23.5k64077
23.5k64077
asked Aug 5 '16 at 3:19
user2636464
31619
31619
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
Try first, from the query_language and cleartool find
, the syntax
cleartool find <vobtag> -element "!{created_since(target-data-time)}" -print
If that does not work, you would then have to fallback to:
- list all files with a version created in the last 30 days
- list all files and extract the ones which are not part of the first list.
Regarding said first list (from "How to determine the last time a VOB was modified"), using cleartool find
:
cleartool find <vobtag> -element "{created_since(target-data-time)}" -print
or
cleartool find <vobtag> -version "{created_since(target-data-time)}" -print
That document also mentions cleartool lshistory -minor -all .
, but that unreliable as it uses local metadata that can be scrapped at any time.
For the second list:
cleartool find . -cview -ele -print
I have tried the first option.But, as there are thousands of files,i am not 100% sure about it if its correct.
– user2636464
Aug 5 '16 at 6:10
@user2636464 just pick one and see its version tree, to see if there are versions created sonce those last 30 days
– VonC
Aug 5 '16 at 6:12
The cleartool find command at the top will work on the element creation date, and not the version timestamps... I think there is a way, let me see if I can create something. I believe that you can use the find -version "created_since..." to give you a list of elements with modifications, and then diff it against a list of all elements in the VOB.
– Brian Cowan
Aug 5 '16 at 14:51
@BrianCowan I suspected as much. And using version wouldn't do any good, as it would list all versions created before a certain date, while there could still be versions created after.
– VonC
Aug 5 '16 at 14:53
" I believe that you can use the find -version "created_since..." ": that is what I propose in the second part of my answer.
– VonC
Aug 5 '16 at 14:54
add a comment |
up vote
1
down vote
Here is a sample Perl script to do what you're asking for. This has a hard-coded date string to avoid getting bogged down in Perl date arithmetic. It takes the list of all elements in the VOB, and then deletes elements with versions modified since the date specified from that list, finally outputting the non-modified elements.
#!/usr/bin/Perl -w
my %elem_hash;
my $datestring="01-jan-2014";
my $demarq= "-------------------------------------------------";
my $allelemtxt="-- All elements located in the current VOB --";
my $ver_hdr ="-- Versions modified since $datestring --";
my $nonmodtext="-- Elements not modified since $datestring --";
#
# Get all elements in the current VOB.
#
$cmdout=`cleartool find -all -print`;
@elemtext=split('n',$cmdout);
#
# Add them to a hashmap, simply because it's easier to delete from this list type
#
foreach $elem (@elemtext)
{
# Quick and dirty way to remove the @@
$elem = substr($elem,0,length($elem)-2);
$elem_hash{$elem} = 1;
}
#
printf("n%sn%sn%sn",$demarq,$allelemtxt,$demarq);
foreach $elem2 (sort (keys (%elem_hash)))
{
printf("Element: %sn",$elem2);
}
#
# Get VERSIONS modified since the specified date string
#
$cmdout=`cleartool find -all -version "created_since($datestring)" -print`;
@vertext=split('n',$cmdout);
#
# strip the trailing version id's and then delete the resulting key from the hashmap.
#
printf("n%sn%sn%sn",$demarq,$ver_hdr,$demarq);
foreach $version (@vertext)
{
printf("Version: %sn",$version);
$version=substr($version,0,length($version)-(length($version)- rindex($version,"@@")));
if (exists($elem_hash{$version}))
{
delete $elem_hash{$version};
}
}
printf("n%sn%sn%sn",$demarq,$nonmodtext,$demarq);
foreach $elem2 (sort (keys (%elem_hash)))
{
printf("Element: %sn",$elem2);
}
thanks a lot for this
– user2636464
Aug 10 '16 at 9:06
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Try first, from the query_language and cleartool find
, the syntax
cleartool find <vobtag> -element "!{created_since(target-data-time)}" -print
If that does not work, you would then have to fallback to:
- list all files with a version created in the last 30 days
- list all files and extract the ones which are not part of the first list.
Regarding said first list (from "How to determine the last time a VOB was modified"), using cleartool find
:
cleartool find <vobtag> -element "{created_since(target-data-time)}" -print
or
cleartool find <vobtag> -version "{created_since(target-data-time)}" -print
That document also mentions cleartool lshistory -minor -all .
, but that unreliable as it uses local metadata that can be scrapped at any time.
For the second list:
cleartool find . -cview -ele -print
I have tried the first option.But, as there are thousands of files,i am not 100% sure about it if its correct.
– user2636464
Aug 5 '16 at 6:10
@user2636464 just pick one and see its version tree, to see if there are versions created sonce those last 30 days
– VonC
Aug 5 '16 at 6:12
The cleartool find command at the top will work on the element creation date, and not the version timestamps... I think there is a way, let me see if I can create something. I believe that you can use the find -version "created_since..." to give you a list of elements with modifications, and then diff it against a list of all elements in the VOB.
– Brian Cowan
Aug 5 '16 at 14:51
@BrianCowan I suspected as much. And using version wouldn't do any good, as it would list all versions created before a certain date, while there could still be versions created after.
– VonC
Aug 5 '16 at 14:53
" I believe that you can use the find -version "created_since..." ": that is what I propose in the second part of my answer.
– VonC
Aug 5 '16 at 14:54
add a comment |
up vote
1
down vote
accepted
Try first, from the query_language and cleartool find
, the syntax
cleartool find <vobtag> -element "!{created_since(target-data-time)}" -print
If that does not work, you would then have to fallback to:
- list all files with a version created in the last 30 days
- list all files and extract the ones which are not part of the first list.
Regarding said first list (from "How to determine the last time a VOB was modified"), using cleartool find
:
cleartool find <vobtag> -element "{created_since(target-data-time)}" -print
or
cleartool find <vobtag> -version "{created_since(target-data-time)}" -print
That document also mentions cleartool lshistory -minor -all .
, but that unreliable as it uses local metadata that can be scrapped at any time.
For the second list:
cleartool find . -cview -ele -print
I have tried the first option.But, as there are thousands of files,i am not 100% sure about it if its correct.
– user2636464
Aug 5 '16 at 6:10
@user2636464 just pick one and see its version tree, to see if there are versions created sonce those last 30 days
– VonC
Aug 5 '16 at 6:12
The cleartool find command at the top will work on the element creation date, and not the version timestamps... I think there is a way, let me see if I can create something. I believe that you can use the find -version "created_since..." to give you a list of elements with modifications, and then diff it against a list of all elements in the VOB.
– Brian Cowan
Aug 5 '16 at 14:51
@BrianCowan I suspected as much. And using version wouldn't do any good, as it would list all versions created before a certain date, while there could still be versions created after.
– VonC
Aug 5 '16 at 14:53
" I believe that you can use the find -version "created_since..." ": that is what I propose in the second part of my answer.
– VonC
Aug 5 '16 at 14:54
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Try first, from the query_language and cleartool find
, the syntax
cleartool find <vobtag> -element "!{created_since(target-data-time)}" -print
If that does not work, you would then have to fallback to:
- list all files with a version created in the last 30 days
- list all files and extract the ones which are not part of the first list.
Regarding said first list (from "How to determine the last time a VOB was modified"), using cleartool find
:
cleartool find <vobtag> -element "{created_since(target-data-time)}" -print
or
cleartool find <vobtag> -version "{created_since(target-data-time)}" -print
That document also mentions cleartool lshistory -minor -all .
, but that unreliable as it uses local metadata that can be scrapped at any time.
For the second list:
cleartool find . -cview -ele -print
Try first, from the query_language and cleartool find
, the syntax
cleartool find <vobtag> -element "!{created_since(target-data-time)}" -print
If that does not work, you would then have to fallback to:
- list all files with a version created in the last 30 days
- list all files and extract the ones which are not part of the first list.
Regarding said first list (from "How to determine the last time a VOB was modified"), using cleartool find
:
cleartool find <vobtag> -element "{created_since(target-data-time)}" -print
or
cleartool find <vobtag> -version "{created_since(target-data-time)}" -print
That document also mentions cleartool lshistory -minor -all .
, but that unreliable as it uses local metadata that can be scrapped at any time.
For the second list:
cleartool find . -cview -ele -print
edited Aug 5 '16 at 6:03
answered Aug 5 '16 at 5:55
VonC
825k28425933127
825k28425933127
I have tried the first option.But, as there are thousands of files,i am not 100% sure about it if its correct.
– user2636464
Aug 5 '16 at 6:10
@user2636464 just pick one and see its version tree, to see if there are versions created sonce those last 30 days
– VonC
Aug 5 '16 at 6:12
The cleartool find command at the top will work on the element creation date, and not the version timestamps... I think there is a way, let me see if I can create something. I believe that you can use the find -version "created_since..." to give you a list of elements with modifications, and then diff it against a list of all elements in the VOB.
– Brian Cowan
Aug 5 '16 at 14:51
@BrianCowan I suspected as much. And using version wouldn't do any good, as it would list all versions created before a certain date, while there could still be versions created after.
– VonC
Aug 5 '16 at 14:53
" I believe that you can use the find -version "created_since..." ": that is what I propose in the second part of my answer.
– VonC
Aug 5 '16 at 14:54
add a comment |
I have tried the first option.But, as there are thousands of files,i am not 100% sure about it if its correct.
– user2636464
Aug 5 '16 at 6:10
@user2636464 just pick one and see its version tree, to see if there are versions created sonce those last 30 days
– VonC
Aug 5 '16 at 6:12
The cleartool find command at the top will work on the element creation date, and not the version timestamps... I think there is a way, let me see if I can create something. I believe that you can use the find -version "created_since..." to give you a list of elements with modifications, and then diff it against a list of all elements in the VOB.
– Brian Cowan
Aug 5 '16 at 14:51
@BrianCowan I suspected as much. And using version wouldn't do any good, as it would list all versions created before a certain date, while there could still be versions created after.
– VonC
Aug 5 '16 at 14:53
" I believe that you can use the find -version "created_since..." ": that is what I propose in the second part of my answer.
– VonC
Aug 5 '16 at 14:54
I have tried the first option.But, as there are thousands of files,i am not 100% sure about it if its correct.
– user2636464
Aug 5 '16 at 6:10
I have tried the first option.But, as there are thousands of files,i am not 100% sure about it if its correct.
– user2636464
Aug 5 '16 at 6:10
@user2636464 just pick one and see its version tree, to see if there are versions created sonce those last 30 days
– VonC
Aug 5 '16 at 6:12
@user2636464 just pick one and see its version tree, to see if there are versions created sonce those last 30 days
– VonC
Aug 5 '16 at 6:12
The cleartool find command at the top will work on the element creation date, and not the version timestamps... I think there is a way, let me see if I can create something. I believe that you can use the find -version "created_since..." to give you a list of elements with modifications, and then diff it against a list of all elements in the VOB.
– Brian Cowan
Aug 5 '16 at 14:51
The cleartool find command at the top will work on the element creation date, and not the version timestamps... I think there is a way, let me see if I can create something. I believe that you can use the find -version "created_since..." to give you a list of elements with modifications, and then diff it against a list of all elements in the VOB.
– Brian Cowan
Aug 5 '16 at 14:51
@BrianCowan I suspected as much. And using version wouldn't do any good, as it would list all versions created before a certain date, while there could still be versions created after.
– VonC
Aug 5 '16 at 14:53
@BrianCowan I suspected as much. And using version wouldn't do any good, as it would list all versions created before a certain date, while there could still be versions created after.
– VonC
Aug 5 '16 at 14:53
" I believe that you can use the find -version "created_since..." ": that is what I propose in the second part of my answer.
– VonC
Aug 5 '16 at 14:54
" I believe that you can use the find -version "created_since..." ": that is what I propose in the second part of my answer.
– VonC
Aug 5 '16 at 14:54
add a comment |
up vote
1
down vote
Here is a sample Perl script to do what you're asking for. This has a hard-coded date string to avoid getting bogged down in Perl date arithmetic. It takes the list of all elements in the VOB, and then deletes elements with versions modified since the date specified from that list, finally outputting the non-modified elements.
#!/usr/bin/Perl -w
my %elem_hash;
my $datestring="01-jan-2014";
my $demarq= "-------------------------------------------------";
my $allelemtxt="-- All elements located in the current VOB --";
my $ver_hdr ="-- Versions modified since $datestring --";
my $nonmodtext="-- Elements not modified since $datestring --";
#
# Get all elements in the current VOB.
#
$cmdout=`cleartool find -all -print`;
@elemtext=split('n',$cmdout);
#
# Add them to a hashmap, simply because it's easier to delete from this list type
#
foreach $elem (@elemtext)
{
# Quick and dirty way to remove the @@
$elem = substr($elem,0,length($elem)-2);
$elem_hash{$elem} = 1;
}
#
printf("n%sn%sn%sn",$demarq,$allelemtxt,$demarq);
foreach $elem2 (sort (keys (%elem_hash)))
{
printf("Element: %sn",$elem2);
}
#
# Get VERSIONS modified since the specified date string
#
$cmdout=`cleartool find -all -version "created_since($datestring)" -print`;
@vertext=split('n',$cmdout);
#
# strip the trailing version id's and then delete the resulting key from the hashmap.
#
printf("n%sn%sn%sn",$demarq,$ver_hdr,$demarq);
foreach $version (@vertext)
{
printf("Version: %sn",$version);
$version=substr($version,0,length($version)-(length($version)- rindex($version,"@@")));
if (exists($elem_hash{$version}))
{
delete $elem_hash{$version};
}
}
printf("n%sn%sn%sn",$demarq,$nonmodtext,$demarq);
foreach $elem2 (sort (keys (%elem_hash)))
{
printf("Element: %sn",$elem2);
}
thanks a lot for this
– user2636464
Aug 10 '16 at 9:06
add a comment |
up vote
1
down vote
Here is a sample Perl script to do what you're asking for. This has a hard-coded date string to avoid getting bogged down in Perl date arithmetic. It takes the list of all elements in the VOB, and then deletes elements with versions modified since the date specified from that list, finally outputting the non-modified elements.
#!/usr/bin/Perl -w
my %elem_hash;
my $datestring="01-jan-2014";
my $demarq= "-------------------------------------------------";
my $allelemtxt="-- All elements located in the current VOB --";
my $ver_hdr ="-- Versions modified since $datestring --";
my $nonmodtext="-- Elements not modified since $datestring --";
#
# Get all elements in the current VOB.
#
$cmdout=`cleartool find -all -print`;
@elemtext=split('n',$cmdout);
#
# Add them to a hashmap, simply because it's easier to delete from this list type
#
foreach $elem (@elemtext)
{
# Quick and dirty way to remove the @@
$elem = substr($elem,0,length($elem)-2);
$elem_hash{$elem} = 1;
}
#
printf("n%sn%sn%sn",$demarq,$allelemtxt,$demarq);
foreach $elem2 (sort (keys (%elem_hash)))
{
printf("Element: %sn",$elem2);
}
#
# Get VERSIONS modified since the specified date string
#
$cmdout=`cleartool find -all -version "created_since($datestring)" -print`;
@vertext=split('n',$cmdout);
#
# strip the trailing version id's and then delete the resulting key from the hashmap.
#
printf("n%sn%sn%sn",$demarq,$ver_hdr,$demarq);
foreach $version (@vertext)
{
printf("Version: %sn",$version);
$version=substr($version,0,length($version)-(length($version)- rindex($version,"@@")));
if (exists($elem_hash{$version}))
{
delete $elem_hash{$version};
}
}
printf("n%sn%sn%sn",$demarq,$nonmodtext,$demarq);
foreach $elem2 (sort (keys (%elem_hash)))
{
printf("Element: %sn",$elem2);
}
thanks a lot for this
– user2636464
Aug 10 '16 at 9:06
add a comment |
up vote
1
down vote
up vote
1
down vote
Here is a sample Perl script to do what you're asking for. This has a hard-coded date string to avoid getting bogged down in Perl date arithmetic. It takes the list of all elements in the VOB, and then deletes elements with versions modified since the date specified from that list, finally outputting the non-modified elements.
#!/usr/bin/Perl -w
my %elem_hash;
my $datestring="01-jan-2014";
my $demarq= "-------------------------------------------------";
my $allelemtxt="-- All elements located in the current VOB --";
my $ver_hdr ="-- Versions modified since $datestring --";
my $nonmodtext="-- Elements not modified since $datestring --";
#
# Get all elements in the current VOB.
#
$cmdout=`cleartool find -all -print`;
@elemtext=split('n',$cmdout);
#
# Add them to a hashmap, simply because it's easier to delete from this list type
#
foreach $elem (@elemtext)
{
# Quick and dirty way to remove the @@
$elem = substr($elem,0,length($elem)-2);
$elem_hash{$elem} = 1;
}
#
printf("n%sn%sn%sn",$demarq,$allelemtxt,$demarq);
foreach $elem2 (sort (keys (%elem_hash)))
{
printf("Element: %sn",$elem2);
}
#
# Get VERSIONS modified since the specified date string
#
$cmdout=`cleartool find -all -version "created_since($datestring)" -print`;
@vertext=split('n',$cmdout);
#
# strip the trailing version id's and then delete the resulting key from the hashmap.
#
printf("n%sn%sn%sn",$demarq,$ver_hdr,$demarq);
foreach $version (@vertext)
{
printf("Version: %sn",$version);
$version=substr($version,0,length($version)-(length($version)- rindex($version,"@@")));
if (exists($elem_hash{$version}))
{
delete $elem_hash{$version};
}
}
printf("n%sn%sn%sn",$demarq,$nonmodtext,$demarq);
foreach $elem2 (sort (keys (%elem_hash)))
{
printf("Element: %sn",$elem2);
}
Here is a sample Perl script to do what you're asking for. This has a hard-coded date string to avoid getting bogged down in Perl date arithmetic. It takes the list of all elements in the VOB, and then deletes elements with versions modified since the date specified from that list, finally outputting the non-modified elements.
#!/usr/bin/Perl -w
my %elem_hash;
my $datestring="01-jan-2014";
my $demarq= "-------------------------------------------------";
my $allelemtxt="-- All elements located in the current VOB --";
my $ver_hdr ="-- Versions modified since $datestring --";
my $nonmodtext="-- Elements not modified since $datestring --";
#
# Get all elements in the current VOB.
#
$cmdout=`cleartool find -all -print`;
@elemtext=split('n',$cmdout);
#
# Add them to a hashmap, simply because it's easier to delete from this list type
#
foreach $elem (@elemtext)
{
# Quick and dirty way to remove the @@
$elem = substr($elem,0,length($elem)-2);
$elem_hash{$elem} = 1;
}
#
printf("n%sn%sn%sn",$demarq,$allelemtxt,$demarq);
foreach $elem2 (sort (keys (%elem_hash)))
{
printf("Element: %sn",$elem2);
}
#
# Get VERSIONS modified since the specified date string
#
$cmdout=`cleartool find -all -version "created_since($datestring)" -print`;
@vertext=split('n',$cmdout);
#
# strip the trailing version id's and then delete the resulting key from the hashmap.
#
printf("n%sn%sn%sn",$demarq,$ver_hdr,$demarq);
foreach $version (@vertext)
{
printf("Version: %sn",$version);
$version=substr($version,0,length($version)-(length($version)- rindex($version,"@@")));
if (exists($elem_hash{$version}))
{
delete $elem_hash{$version};
}
}
printf("n%sn%sn%sn",$demarq,$nonmodtext,$demarq);
foreach $elem2 (sort (keys (%elem_hash)))
{
printf("Element: %sn",$elem2);
}
answered Aug 5 '16 at 16:31
Brian Cowan
72546
72546
thanks a lot for this
– user2636464
Aug 10 '16 at 9:06
add a comment |
thanks a lot for this
– user2636464
Aug 10 '16 at 9:06
thanks a lot for this
– user2636464
Aug 10 '16 at 9:06
thanks a lot for this
– user2636464
Aug 10 '16 at 9:06
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f38780553%2ffind-list-of-files-not-modified-for-last-30-days-in-clearcase%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown