Using the Grid/Replication

From BiGGrid Wiki
Revision as of 10:58, 28 June 2011 by Machiel.Jansen (talk | contribs) (Created page with "*Problem: You want to replicate a file to all the existing storage elements *Solution: Use the following script. *Precondition: You must have set LFC_HOST to lfc.grid.sara.nl an...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  • Problem: You want to replicate a file to all the existing storage elements
  • Solution: Use the following script.
  • Precondition: You must have set LFC_HOST to lfc.grid.sara.nl and have started a valid GridSession.
export LFC_HOST=lfc.grid.sara.nl
startGridSession [voname]

The script for replication:

#!/bin/bash

# For debugging:
set -x

# Minimal input check:
if [ $# -ne 2 ]; then
        echo "Usage: $0 <filename> <lfn>" >&2
        exit 1
fi

# Build a list of all SE's on the Grid:
SES=$(
        lcg-infosites --vo lsgrid se | grep -Po '\b\S+$' | grep '\.'
)

# Delete all replica's of the file (if there are any):
lcg-del -a lfn:$2
# Copy-and-register the file in the default SE:
lcg-cr -l "$2" "$1" || exit 2
# Replicate the file over all SE's:
for se in $SES; do
        lcg-rep -d $se --vo lsgrid lfn:$2
done

See also

Vbrowser a tool that can be used for replication as well.