Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Locking files across branches
johnjamesmarsh
ts 5.5.2, Solaris
Hi,
I have a requirement to lock a file across multiple branches. I have written a script using the iwatlock trigger that does the job. The problem I have is that when each file is locked it triggers off another iwatlock trigger. With lots of branches this gets slow.
Anyone have any ideas about how I can stop the unwanted triggers? Here is the code I am using:
--------------------------------------------
#!/bin/ksh
Filepath=$IW_FILEPATH
BRANCHES="/iwmnt/default/main/AA/MR /iwmnt/default/main/AA/WR /iwmnt/default/main/AA/Content"
for branch in $BRANCHES
{
for workarea in `iwlist $branch`
{
vpath="$branch/$workarea/WORKAREA/$workarea/$Filepath"
ls $vpath >/dev/null 2>&1
if [ $? -eq 0 ];
then
echo if [ \$\? = 0 ];
if [ "`iwfilestate -f script $vpath |grep 'locked=no'`" = "locked=no" ];
then
echo "iwfilestate -f script $vpath |grep 'locked=no' = \"locked=no\""
echo iwlock -f $vpath "This file is locked";
iwlock -f $vpath "This file is locked";
fi;
fi;
}
}
------------------------------------------
Any idea would be gratefully received.
John
Find more posts tagged with
Comments
Adam Stoller
I don't have time to think this through thoroughly but here's the gist of what I'd suggest trying.
(b - yes 'b', you'll understand in a moment) Have the trigger script create a list of all the files it is about to lock and store it in a well know location (perhaps something like IWHOME/tmp/filename.locking - where 'filename' would be the name of the file you are going to lock in all the branches)
(a - I told you that, so I could tell you this) - At the beginning of the trigger script check to see if the file that triggered it is already being processed for locking - if so, gracefully exit out.
(c) When done locking the file in all the branches, remove the filename.locking file
--fish
(Interwoven Senior Technical Consultant)
nipper
THis is why I did not do a trigger for this.
I made a custom menu item called lock all & it does a
remote lock on the other systems
Andy
johnjamesmarsh
Thanks for that suggestion. I can see how that will work.
I need this to happen automatically via some kind of trigger as I have need to be able to rely on the file being locked and not people remembering to lock it. Though I can see that I could make it so that they can't edit the file unless they have locked it first. I might think about that when I get some time.
John