Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
irods-rules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RDM Infrastructure
irods-rules
Commits
cc7fc3f4
Commit
cc7fc3f4
authored
3 years ago
by
Staiger, Christine
Browse files
Options
Downloads
Patches
Plain Diff
Delete tarCollection.r
parent
84449704
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
interactiveRules/tar-test-rules/tarCollection.r
+0
-60
0 additions, 60 deletions
interactiveRules/tar-test-rules/tarCollection.r
with
0 additions
and
60 deletions
interactiveRules/tar-test-rules/tarCollection.r
deleted
100644 → 0
+
0
−
60
View file @
84449704
tarCollection
{
msiGetObjType
(
*
coll
,
*
objType
);
*
s
=
size
(
split
(
*
coll
,
"/"
));
#path level needs to be deeper than /zone/home/user
msiGetObjType
(
*
resource
,
*
rescType
)
if
(
*
objType
!=
"-c"
){
writeLine
(
"stderr"
,
"ERROR tarCollection: *coll not a collection."
);
msiGoodFailure
()
}
if
(
int
(
*
s
)
<
4
){
writeLine
(
"stderr"
,
"ERROR tarCollection: cannot bundle root or home of users."
);
msiGoodFailure
()
}
if
(
*
rescType
!=
"-r"
){
writeLine
(
"stderr"
,
"ERROR tarCollection: *resource not a resource."
);
msiGoodFailure
()
}
#get size of collection
*
size1
=
0
;
*
size2
=
0
;
*
rescSize
=
0
;
foreach
(
*
row
in
SELECT
sum
(
DATA_SIZE
)
where
COLL_NAME
like
"*coll/%"
){
*
size1
=
int
(
*
row.DATA_SIZE
);
}
foreach
(
*
row
in
SELECT
sum
(
DATA_SIZE
)
where
COLL_NAME
like
"*coll"
){
*
size2
=
int
(
*
row.DATA_SIZE
);
}
*
size
=
*
size1
+
*
size2
;
if
(
*
size
==
0
){
writeLine
(
"stderr"
,
"ERROR tarCollection: Empty coll *coll, no data to tar."
)
msiGoodFailure
()
}
writeLine
(
"stdout"
,
"DEBUG tarCollection: Coll size: *size"
);
foreach
(
*
row
in
SELECT
RESC_FREE_SPACE
where
RESC_NAME
like
*
resource
){
*
rescSize
=
int
(
*
row.RESC_FREE_SPACE
);
}
writeLine
(
"stdout"
,
"DEBUG tarCollection: Resc size: *rescSize."
);
if
(
*
rescSize
<
*
size
*
2
-*
rescSize
/
10
){
writeLine
(
"stderr"
,
"ERROR tarCollection: Not enough space on *resource"
);
msiGoodFailure
()
}
msiSplitPath
(
*
coll
,
*
parentColl
,
*
collName
);
if
(
bool
(
*
compress
)){
*
tarFile
=
"*parentColl/*collName.zip"
}
else
{
*
tarFile
=
"*parentColl/*collName.irods.tar"
}
writeLine
(
"stdout"
,
"Create *tarFile"
);
msiArchiveCreate
(
*
tarFile
,
*
coll
);
if
(
bool
(
*
delete
)){
msiRmColl
(
*
coll
,
"forceFlag="
,
*
out
);
writeLine
(
"stdout"
,
*
out
);
}
*
tarFile
}
input
*
coll
=
"/npecZone/home/cstaiger/TEST"
,
*
resource
=
"disk"
,
*
compress
=
"false"
,
*
delete
=
"false"
output
ruleExecOut
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment