#!/usr/bin/bash -e #ssh cree dateList="[1-9]*[0-9]" echo tarring directories $dateList for date in $dateList do tar cf $date.tar $date if [[ !$? ]]; then echo removing $date rm -r $date else echo $date not tarred so not removed fi # nohup /usr/sbin/nsr/nsrarchive -v -b "dept archive" -s uther \ # -T "current weather data plots animations $date" $date \ # 1> archive$date.log 2>& 1 done