source: trunk/Mars/datacenter/scripts/movingsubsystemfiles@ 19945

Last change on this file since 19945 was 8482, checked in by Daniela Dorner, 18 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/bin/sh
2#
3# ========================================================================
4#
5# *
6# * This file is part of MARS, the MAGIC Analysis and Reconstruction
7# * Software. It is distributed to you in the hope that it can be a useful
8# * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
9# * It is distributed WITHOUT ANY WARRANTY.
10# *
11# * Permission to use, copy, modify and distribute this software and its
12# * documentation for any purpose is hereby granted without fee,
13# * provided that the above copyright notice appear in all copies and
14# * that both that copyright notice and this permission notice appear
15# * in supporting documentation. It is provided "as is" without express
16# * or implied warranty.
17# *
18#
19#
20# Author(s): Daniela Dorner 08/2004 <mailto:dorner@astro.uni-wuerzburg.de>
21#
22# Copyright: MAGIC Software Development, 2000-2007
23#
24#
25# ========================================================================
26#
27# This script is moving the subsystemfiles from the directory
28# /magic/datacenter/fromtape to the structure
29# /magic/subsystemdata/subsystem/YYYY/MM/DD
30#
31
32umask 0002
33
34# change permission for files
35# perhaps needed as the tapes are read by the user tape
36ssh tape@dc07 chmod -R g+w /magic/datacenter/fromtape/{ccdata,cacodata,amc,daqlog}/*
37
38# find subsystem files
39subsysfiles=`find /magic/datacenter/fromtape/ccdata/ -name '*.*'`
40subsysfiles=("${subsysfiles[@]}" `find /magic/datacenter/fromtape/daqlog/ -name '*.*'`)
41subsysfiles=("${subsysfiles[@]}" `find /magic/datacenter/fromtape/cacodata/ -name '*.*'`)
42subsysfiles=("${subsysfiles[@]}" `find /magic/datacenter/fromtape/amc/ -name '*.*'`)
43
44# moving subsystem files
45for subsysfile in ${subsysfiles[@]}
46do
47 newsubsysfile=`echo $subsysfile | sed -e 's/datacenter\/fromtape/subsystemdata/g' -e 's/daqlog/daq__/g' -e 's/ccdata/cc/g' -e 's/cacodata/caco/g' -e 's/_/\//1' -e 's/_/\//1' -e 's/\/\///g'`
48 newdir=`dirname $newsubsysfile`
49 if [ ! -d $newdir ]
50 then
51 echo "make dir "$newdir
52 mkdir -p $newdir
53 fi
54
55 mv -v $subsysfile $newsubsysfile
56done
57
Note: See TracBrowser for help on using the repository browser.