- Timestamp:
- 02/19/09 21:22:19 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/movingrawfiles_OK
r8685 r9355 43 43 umask 0002 44 44 45 scriptlog=$runlogpath/$program-$datetime.log46 date >> $scriptlog 2>&147 48 45 # check whether script is already running 49 46 lockfile=$lockpath/lock-$program.txt 50 checklock >> $scriptlog 2>&147 checklock 51 48 52 49 # change permission for files 53 ssh tape@dc07 chmod -R g+w /magic/datacenter/fromtape/rawdata/* >> $scriptlog 2>&154 ssh lapalma@dc09 chmod -R g+w /magic/datacenter/fromlapalma/RAW*/ >> $scriptlog 2>&150 ssh tape@dc07 chmod -R g+w /magic/datacenter/fromtape/rawdata/* 51 ssh lapalma@dc09 chmod -R g+w /magic/datacenter/fromlapalma/RAW*/ 55 52 # output for chmod with -v or -c (only changes) 56 53 … … 61 58 then 62 59 # change permission for this directories 63 ssh lapalma@dc09 chmod -R g+w $dirs >> $scriptlog 2>&160 ssh lapalma@dc09 chmod -R g+w $dirs 64 61 # move directories to the tapedirectory 65 62 dates=`find /magic/datacenter/fromlapalma/RAW/*200* -type d | cut -d/ -f6` 66 63 for date in ${dates[@]} 67 64 do 68 ssh lapalma@dc09 mkdir /magic/datacenter/fromlapalma/RAWchk/$date >> $scriptlog 2>&169 makedir /magic/datacenter/fromtape/rawdata/$date >> $scriptlog 2>&165 ssh lapalma@dc09 mkdir /magic/datacenter/fromlapalma/RAWchk/$date 66 makedir /magic/datacenter/fromtape/rawdata/$date 70 67 71 68 OKs=`ls /magic/datacenter/fromlapalma/RAW/$date/*.OK` 72 69 for OK in ${OKs[@]} 73 70 do 74 ssh lapalma@dc09 mv -v $OK /magic/datacenter/fromlapalma/RAWchk/$date/ >> $scriptlog 2>&171 ssh lapalma@dc09 mv -v $OK /magic/datacenter/fromlapalma/RAWchk/$date/ 75 72 files=`echo $OK | sed -e 's/.OK//g'` 76 mv -v $files /magic/datacenter/fromtape/rawdata/$date/ >> $scriptlog 2>&173 mv -v $files /magic/datacenter/fromtape/rawdata/$date/ 77 74 done 78 75 done 79 76 fi 80 77 81 rmdir -v /magic/datacenter/fromlapalma/RAW/*200* >> $scriptlog 2>&178 rmdir -v /magic/datacenter/fromlapalma/RAW/*200* 82 79 83 80 # find rawfiles … … 86 83 if [ "$rawfiles" == "" ] 87 84 then 88 echo "no files to move -> exit" >> $scriptlog 2>&189 finish >> $scriptlog 2>&185 printprocesslog "INFO no files to move -> exit" 86 finish 90 87 fi 91 88 … … 97 94 newrawfile=`echo $rawfile | sed -e 's/center\/fromtape\/rawdata/\/rawfiles/g' -e 's/_/\//1' -e 's/_/\//1'` 98 95 newdir=`dirname $newrawfile` 99 makedir $newdir >> $scriptlog 2>&196 makedir $newdir 100 97 101 mv -v $rawfile $newrawfile >> $scriptlog 2>&198 mv -v $rawfile $newrawfile 102 99 done 103 100 104 rmdir -v /magic/datacenter/fromtape/rawdata/* >> $scriptlog 2>&1101 rmdir -v /magic/datacenter/fromtape/rawdata/* 105 102 106 103 printprocesslog "INFO launching filesondisk" 107 echo "launching filesondisk" >> $scriptlog 2>&1108 104 $scriptspath/filesondisk& 109 105 110 finish >> $scriptlog 2>&1106 finish 111 107
Note:
See TracChangeset
for help on using the changeset viewer.