24 lines
641 B
Python
Executable File
24 lines
641 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import argparse
|
|
import subprocess
|
|
|
|
def parse_args():
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("--date", "-d", type=str)
|
|
return parser.parse_args()
|
|
|
|
def main():
|
|
args = parse_args()
|
|
remote_dir = f'/data/emblem-research/camera-frame'
|
|
if args.date:
|
|
remote_dir += f'/{args.date}'
|
|
# we cannot rsync to data/json because we will update there after sync, and
|
|
# the next sync will overwrite the updated files
|
|
local_dir = f'data/raw/camera-frame'
|
|
cmd = ['rsync', '-avz', f'zy:{remote_dir}', local_dir]
|
|
subprocess.run(cmd)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|