source: trunk/DataCheck/Transfer/CleanupNewdata.sh@ 19637

Last change on this file since 19637 was 18863, checked in by Daniela Dorner, 8 years ago
added (script to clean up newdata)
  • Property svn:executable set to *
File size: 1.0 KB
Line 
1#!/bin/bash
2
3source `dirname $0`/../Sourcefile.sh
4printprocesslog "INFO starting "$0
5
6# implement here some check whether QLA / RTA are still running
7
8# find directories to be removed
9# keep last 6 days as RsyncAuxLP.sh copies that many days
10dirs=( `find /scratch/aux/ -mindepth 3 -mtime +5 -type d | sort ` )
11
12# delete aux files
13for dir in ${dirs[@]}
14do
15 printprocesslog "INFO deleting files in "$dir
16 echo `date`": deleting files in "$dir
17
18 if ! rm -r $dir
19 then
20 printprocesslog "ERROR could not delete "$dir
21 fi
22done
23
24# find all raw files older than 10 hours
25files=( `find /scratch/raw/ -mindepth 3 -mmin +600 -type f | sort ` )
26
27# delete raw files
28for file in ${files[@]}
29do
30 printprocesslog "INFO deleting file "$file
31 echo `date`": deleting file "$file
32
33 if ! rm $file
34 then
35 printprocesslog "ERROR could not delete "$file
36 fi
37done
38
39dirs=( `find /scratch/raw -type d -empty` )
40for dir in ${dirs[@]}
41do
42 printprocesslog "INFO deleting directory "$dir
43 rmdir $dir
44done
45
46finish
Note: See TracBrowser for help on using the repository browser.