Skip to content

Commit

Permalink
Fix #29.
Browse files Browse the repository at this point in the history
  • Loading branch information
nbiederbeck committed Apr 21, 2023
1 parent d9637eb commit 980fc0b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 18 deletions.
35 changes: 35 additions & 0 deletions lapalma.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python3
from argparse import ArgumentParser
from subprocess import run

parser = ArgumentParser(
description="Copy data files from the cluster to locally create plots.",
)
parser.add_argument(
"--hostname",
help="The hostname as configured in you ~/.ssh/config, e.g. `cp01`.",
required=True,
)
parser.add_argument(
"--remote-path",
help="Path to your directory on the cluster, "
"e.g. `/fefs/aswg/workspace/<username>/lst-agn-analysis/`. "
"Can be absolute (start with `/`) otherwise it is relative to the home.",
required=True,
)
args = parser.parse_args()

filelist = [
"build/dl1-datachecks-masked.h5",
]
files = "{" + ",".join(filelist) + "}"


def main():
rsync = "rsync -auh --info=progress2 --exclude-from=.gitignore"
cmd = f"{rsync} '{args.hostname}:{args.remote_path}/{files}' ."
run(cmd, shell=True, capture_output=True, check=True)


if __name__ == "__main__":
main()
18 changes: 0 additions & 18 deletions lapalma.sh

This file was deleted.

0 comments on commit 980fc0b

Please sign in to comment.