| 176 | |
| 177 | = Additional scripts == |
| 178 | |
| 179 | Define the source folders (where data has been converted) and final destination (folder where data is served). Sometimes the name are different. |
| 180 | |
| 181 | For example |
| 182 | |
| 183 | {{{ |
| 184 | sources=("lifelines_OV0xy" "lifelines_OV0xy") |
| 185 | targets=("lifelines_OV0ab" "lifelines_OV0cd") |
| 186 | }}} |
| 187 | |
| 188 | Script to check if all folders are there |
| 189 | |
| 190 | {{{ |
| 191 | total=${#sources[*]} |
| 192 | for (( i=0; i<=$(( $total -1 )); i++ )) do |
| 193 | if [ -d /target/gpfs2/lifelines-genome/home/${targets[i]}/ ] && [ -d /target/gpfs2/lifelines_rp/releases/LL3/${sources[i]}/ ]; then |
| 194 | echo ${targets[i]} |
| 195 | else |
| 196 | echo "error: "${sources[i]} |
| 197 | fi |
| 198 | }}} |
| 199 | |
| 200 | Batch copy and setup of the data |
| 201 | |
| 202 | {{{ |
| 203 | |
| 204 | total=${#sources[*]} |
| 205 | for (( i=0; i<=$(( $total -1 )); i++ )) do |
| 206 | if [ -d /target/gpfs2/lifelines-genome/home/${targets[i]}/ ] && [ -d /target/gpfs2/lifelines_rp/releases/LL3/${sources[i]}/ ]; then |
| 207 | echo ${targets[i]} |
| 208 | |
| 209 | rm /target/gpfs2/lifelines-genome/home/${targets[i]}/*.bim |
| 210 | rm /target/gpfs2/lifelines-genome/home/${targets[i]}/*.ped |
| 211 | rm /target/gpfs2/lifelines-genome/home/${targets[i]}/*.map |
| 212 | rm /target/gpfs2/lifelines-genome/home/${targets[i]}/*.bed |
| 213 | rm /target/gpfs2/lifelines-genome/home/${targets[i]}/*.dose |
| 214 | rm /target/gpfs2/lifelines-genome/home/${targets[i]}/*.log |
| 215 | rm /target/gpfs2/lifelines-genome/home/${targets[i]}/*.fam |
| 216 | rm /target/gpfs2/lifelines-genome/home/${targets[i]}/*_imputation* |
| 217 | |
| 218 | rsync -av --progress /target/gpfs2/lifelines_rp/releases/LL3/${sources[i]}/ \ |
| 219 | /target/gpfs2/lifelines-genome/home/${targets[i]}/ |
| 220 | |
| 221 | rm /target/gpfs2/lifelines-genome/home/${targets[i]}/temp* |
| 222 | chown -R $user /target/gpfs2/lifelines-genome/home/${targets[i]}/* |
| 223 | chmod -R a-rw /target/gpfs2/lifelines-genome/home/${targets[i]}/* |
| 224 | chmod -R u+r /target/gpfs2/lifelines-genome/home/${targets[i]}/* |
| 225 | |
| 226 | else |
| 227 | echo "error: "${sources[i]} |
| 228 | fi |
| 229 | done |
| 230 | }}} |