#!/bin/sh

## Job Name
#PBS -N copy

## Script to run a script in camelot, IPSL
#PBS -m ae
#PBS -M lluis.fita@lmd.jussieu.fr

## Joins standard and Error outputs in a single file
#PBS -j oe

## Queue
#PBS -q week

### Max run time
#PBS -l walltime=168:00:00

### Max memory
#PBS -l vmem=20gb
#PBS -l mem=20gb

## resources
#PBS -l nodes=1:ppn=1

cd $PBS_O_WORKDIR

dateval=`date "+%Y%m%d%H%M%S"`

rm ${PBS_JOBNAME}.o*
rm run_copy.log

origin=`echo ${origdest} | tr '|' ' ' | awk '{print $1}'`
destiny=`echo ${origdest} | tr '|' ' ' | awk '{print $2}'`

date > run_copy.log
rsync -va --exclude-from=${HOME}/etudes/WRF_LMDZ/svn/LMDZ_WRF/tools/NONcopy.inf -C --no-links ${origin} ${destiny} >& run_copy.log
date >> run_copy.log

## e.g. # qsub -v origdest='medic950116|/bdd/PCER/workspace/lfita/etudes/WRFdynamicoSENS' copy.pbs
