new generic script to wait for a qsub job and then submit an R script