Last change
on this file since 19100 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 |
|
---|
3 | source `dirname $0`/../Sourcefile.sh
|
---|
4 | printprocesslog "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
|
---|
10 | dirs=( `find /scratch/aux/ -mindepth 3 -mtime +5 -type d | sort ` )
|
---|
11 |
|
---|
12 | # delete aux files
|
---|
13 | for dir in ${dirs[@]}
|
---|
14 | do
|
---|
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
|
---|
22 | done
|
---|
23 |
|
---|
24 | # find all raw files older than 10 hours
|
---|
25 | files=( `find /scratch/raw/ -mindepth 3 -mmin +600 -type f | sort ` )
|
---|
26 |
|
---|
27 | # delete raw files
|
---|
28 | for file in ${files[@]}
|
---|
29 | do
|
---|
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
|
---|
37 | done
|
---|
38 |
|
---|
39 | dirs=( `find /scratch/raw -type d -empty` )
|
---|
40 | for dir in ${dirs[@]}
|
---|
41 | do
|
---|
42 | printprocesslog "INFO deleting directory "$dir
|
---|
43 | rmdir $dir
|
---|
44 | done
|
---|
45 |
|
---|
46 | finish
|
---|
Note:
See
TracBrowser
for help on using the repository browser.