Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
dCache
cta
Commits
cdfc32ed
Commit
cdfc32ed
authored
7 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
Added the retrieve_archive_file EOS wfe script
parent
c516812f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
eos_wfe_scripts/retrieve_archive_file
+39
-0
39 additions, 0 deletions
eos_wfe_scripts/retrieve_archive_file
with
39 additions
and
0 deletions
eos_wfe_scripts/retrieve_archive_file
0 → 100755
+
39
−
0
View file @
cdfc32ed
#!/bin/bash
EINVAL
=
22
ECANCELED
=
125
export
XrdSecPROTOCOL
=
sss
export
XrdSecSSSKT
=
/etc/cta/cta-cli.sss.keytab
if
test
$#
-ne
9
;
then
echo
"Wrong number of command-line arguments"
echo
"Usage: retrieve_archive_file wf_tag rusername rgroupname archive_file_id turl disk_username disk_groupname metadata_base64 file_path"
exit
${
EINVAL
}
fi
WF_TAG
=
"
$1
"
RUSERNAME
=
"
$2
"
RGROUPNAME
=
"
$3
"
ARCHIVE_FILE_ID
=
"
$4
"
TURL
=
"
$5
"
DISK_USERNAME
=
"
$6
"
DISK_GROUPNAME
=
"
$7
"
METADATA_BASE64
=
"
$8
"
FILE_PATH
=
"
$9
"
DST_URL
=
${
TURL
}
'\&eos.ruid=0&eos.rgid=0\&eos.injection=1\&eos.workflow=CTA_retrieve'
LOG_FILE
=
"/var/log/eos/wfe/
${
WF_TAG
}
.log"
if
test
UNDEF
=
${
ARCHIVE_FILE_ID
}
;
then
echo
`
date
+%s
`
`
date
`
"
$0
Cannot retrieve an archive file without the sys.archiveFileId attribute being set: rusername=
${
RUSERNAME
}
rgroupname=
${
RGROUPNAME
}
archiveFileId=
${
ARCHIVE_FILE_ID
}
dsturl=
${
DST_URL
}
disk_username=
${
DISK_USERNAME
}
disk_groupname=
${
DISK_GROUPNAME
}
path=
${
FILE_PATH
}
"
>>
${
LOG_FILE
}
exit
${
ECANCELED
}
fi
if
RESULT
=
`
2>&1 /usr/bin/cta retrieve
--user
${
RUSERNAME
}
--group
${
RGROUPNAME
}
--id
${
ARCHIVE_FILE_ID
}
--dsturl
${
DST_URL
}
--diskfilepath
${
FILE_PATH
}
--diskfileowner
${
DISK_USERNAME
}
--diskfilegroup
${
DISK_GROUPNAME
}
--recoveryblob
:base64
${
METADATA_BASE64
}
`
;
then
echo
`
date
+%s
`
`
date
`
"
$0
Queued retrieve request: rusername=
${
RUSERNAME
}
rgroupname=
${
RGROUPNAME
}
archiveFileId=
${
ARCHIVE_FILE_ID
}
dsturl=
${
DST_URL
}
disk_username=
${
DISK_USERNAME
}
disk_groupname=
${
DISK_GROUPNAME
}
path=
${
FILE_PATH
}
"
>>
${
LOG_FILE
}
exit
0
else
echo
`
date
+%s
`
`
date
`
"
$0
Failed to queue retrieve request: error=
${
RESULT
}
rusername=
${
RUSERNAME
}
rgroupname=
${
RGROUPNAME
}
archiveFileId=
${
ARCHIVE_FILE_ID
}
dsturl=
${
DST_URL
}
disk_username=
${
DISK_USERNAME
}
disk_groupname=
${
DISK_GROUPNAME
}
path=
${
FILE_PATH
}
"
>>
${
LOG_FILE
}
exit
${
ECANCELED
}
fi
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