Commit b3581006 authored by Roland Haas's avatar Roland Haas
Browse files

showcase_helper: add example on how to copy between BW and Nearline

parent 1edd7fc4
......@@ -13,15 +13,24 @@ for file in files:
print("%s (%s) [%d bytes]" % \
(file, files[file]['type'], files[file]['size']))
# create a file an duplicate it using globus
# create a file and copy it using globus
foxfile = "%s/%s-foxfile" % (os.getcwd(), os.environ["USER"])
houndfile = "%s/%s-houndfile" % (os.getcwd(), os.environ["USER"])
with open(foxfile, "w") as fh:
fh.write("The quick brown fox jumps over the lazy dog\n")
print("Copying %s to %s" % (foxfile, houndfile))
# copy to Nearline
nearline_foxfile = "~/foxfile"
print("Copying %s to Nearline %s" % (foxfile, nearline_foxfile))
transfer = helper.transfer(globushl.EP_BLUEWATERS, globushl.EP_NEARLINE,
[(foxfile, nearline_foxfile)], synchronous=True)
print("done")
# duplicate on BW
houndfile = "%s/%s-houndfile" % (os.getcwd(), os.environ["USER"])
harefile = "%s/%s-harefile" % (os.getcwd(), os.environ["USER"])
print("Copying %s to BlueWaters %s and %s" % (foxfile, houndfile, harefile))
transfer = helper.transfer(globushl.EP_BLUEWATERS, globushl.EP_BLUEWATERS,
[(foxfile, houndfile)])
[(foxfile, houndfile), (foxfile, harefile)])
helper.task_wait(transfer)
with open(houndfile, "r") as fh:
print("Hounds contains:", fh.readlines())
......@@ -29,6 +38,7 @@ print("done")
# get rid of files
print("Removing files")
helper.delete(globushl.EP_BLUEWATERS, [foxfile, houndfile])
helper.delete(globushl.EP_NEARLINE, nearline_foxfile)
helper.delete(globushl.EP_BLUEWATERS, [foxfile, houndfile, harefile])
print("All done")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment