Skip to content
Snippets Groups Projects
Commit 0699e8ee authored by Steven Murray's avatar Steven Murray
Browse files

Added directory for EOS workflow scripts

parent 6824973c
Branches
Tags
No related merge requests found
This directory contains scripts to be executed by the EOS workflow engine.
These scripts should be installed in the foillowing directory on the EOS
mgm node:
/var/eos/wfe/bash/
For example the following script is executed when a tape server triggers
an archived.default workflow event:
/var/eos/wfe/bash/create_tape_drop_disk_replicas
#!/bin/bash
if test $# -ne 3; then
echo "Wrong number of command-line arguments"
echo "Usage: create_tape_drop_disk_replicas wf_tag file_path tape_fs_id"
exit -1
fi
WF_TAG="$1"
FILE_PATH="$2"
TAPE_FS_ID="$3"
LOG_FILE="/var/log/eos/wfe/${WF_TAG}.log"
echo `date +%s` `date`" $0 Creating tape replica with fsid ${TAPE_FS_ID} for ${FILE_PATH}" >> ${LOG_FILE}
if ! eos -r 0 0 file tag "${FILE_PATH}" +${TAPE_FS_ID}; then
echo `date +%s` `date`" Failed to create tape replica with fsid ${TAPE_FS_ID} for ${FILE_PATH}" >> ${LOG_FILE}
exit 1
fi
for DISK_FSID in `eos file info "${FILE_PATH}" -m | sed s/\ /'\n'/g | grep fsid | sed s/fsid=// | grep -v ${TAPE_FS_ID}`; do
echo `date +%s` `date`" $0 Deleting disk replica with fsid ${DISK_FSID} for ${FILE_PATH}" >> ${LOG_FILE}
if ! eos -r 0 0 file drop "${FILE_PATH}" ${DISK_FSID}; then
echo `date +%s` `date`" $0 Failed to delete disk replica with fsid ${DISK_FSID} for ${FILE_PATH}" >> ${LOG_FILE}
exit 1
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment