#!/bin/bash
#SBATCH -n 1
#SBATCH -t 01:00:00
#SBATCH -J gfasftp
##SBATCH -e /esarchive/recon/ecmwf/gfas/scripts/i535-marc-hourly/out-logs/format-ftp-%j.err
##SBATCH -o /esarchive/recon/ecmwf/gfas/scripts/i535-marc-hourly/out-logs/format-ftp-%j.out

#default values, take if not given in command line
script_root_default=/gpfs/scratch/bsc32/bsc032715/software/GHOST/sync_data
data_root_default=/gpfs/projects/bsc32/AC_cache/obs/ghost
# if network_list_default=default, all nrt networks will be synchronised
network_list_default=NZ_ECAN

# default arguments
script_root=${2:-$script_root_default}
data_root=${3:-$data_root_default}
network_list=${4:-$network_list_default}

# run download script
time python3 -u $script_root/rsync_from_gpfs_to_esarchive.py $script_root $data_root $network_list #script path, download path, network list