Rev 9188 | Rev 13455 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9188 | Rev 11086 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | 1 | limit_class=300 |
|
2 | !if $stepcl=$empty |
2 | !if $stepcl=$empty |
3 | listyear=!listfile -t $wims_home/backup/oldclasses |
3 | listyear=!listfile -t $wims_home/backup/oldclasses |
4 | listyear=!lines2items $listyear |
4 | listyear=!lines2items $listyear |
5 | listyear=!words2items $listyear |
5 | listyear=!words2items $listyear |
6 | !if $listyear=$empty |
6 | !if $listyear=$empty |
7 | error=noyear |
7 | error=noyear |
8 | !exit |
8 | !exit |
9 | !endif |
9 | !endif |
10 | !set cnt=0 |
10 | !set cnt=0 |
11 | !for j in $listyear |
11 | !for j in $listyear |
- | 12 | cnt_=!sh cd $wims_home/backup/oldclasses/$j; find . -maxdepth 1 -type f | wc -l | awk '{print $1}' |
|
- | 13 | !if $cnt_ < $limit_class |
|
12 | listclass$j=!listfile -t $wims_home/backup/oldclasses/$j/*.tgz |
14 | listclass$j=!listfile -t $wims_home/backup/oldclasses/$j/*.tgz |
13 | listclass$j=!replace internal .tgz by in $(listclass$j) |
15 | listclass$j=!replace internal .tgz by in $(listclass$j) |
14 | listclass$j=!replace internal $wims_home/backup/oldclasses/$j/ by in $(listclass$j) |
16 | listclass$j=!replace internal $wims_home/backup/oldclasses/$j/ by in $(listclass$j) |
15 | listclass$j=!words2items $(listclass$j) |
17 | listclass$j=!words2items $(listclass$j) |
- | 18 | listclass$j=!sort numeric items $(listclass$j) |
|
16 | cnt_=!itemcnt $(listclass$j) |
19 | cnt_=!itemcnt $(listclass$j) |
- | 20 | !else |
|
- | 21 | listclass$j=toomuch |
|
- | 22 | !endif |
|
17 | cnt=$[$cnt_+$cnt] |
23 | cnt=$[$cnt_+$cnt] |
18 | !next |
24 | !next |
19 | !else |
25 | !else |
20 | !if $clrestore=$empty |
26 | !if $clrestore=$empty |
21 | error=noclass |
27 | error=noclass |
22 | !reset stepcl test |
28 | !reset stepcl test |
Line 31... | Line 37... | ||
31 | date=$[$date+100] |
37 | date=$[$date+100] |
32 | !endif |
38 | !endif |
33 | class=!replace internal _ by , in $clrestore |
39 | class=!replace internal _ by , in $clrestore |
34 | !distribute item $class into year,class |
40 | !distribute item $class into year,class |
35 | class=!nospace $class |
41 | class=!nospace $class |
- | 42 | !if $class=$empty |
|
- | 43 | !if $clrestore1=$empty |
|
- | 44 | error=noclass |
|
- | 45 | !exit |
|
- | 46 | !else |
|
- | 47 | class=$clrestore1 |
|
- | 48 | class=!text select 1234567890 in $class |
|
- | 49 | !if $class=$empty |
|
- | 50 | error=noclass |
|
- | 51 | !exit |
|
- | 52 | !endif |
|
- | 53 | !endif |
|
- | 54 | !endif |
|
- | 55 | test=!sh cd $wims_home/backup/oldclasses/$year; ls $class.tgz |
|
- | 56 | !if $test!=$class.tgz |
|
- | 57 | error=classnotexists |
|
- | 58 | !exit |
|
- | 59 | !endif |
|
36 | test=!sh cd $wims_home\ |
60 | test=!sh cd $wims_home\ |
37 | cp backup/oldclasses/$year/$class.tgz log/classes/\ |
61 | cp backup/oldclasses/$year/$class.tgz log/classes/\ |
38 | cd $wims_home/log/classes/\ |
62 | cd $wims_home/log/classes/\ |
39 | if [ ! `ls -d $class | wc -c` -eq 0 ] ; then echo "class already existing; nothing is done" ; exit ; fi ;\ |
63 | if [ ! `ls -d $class | wc -c` -eq 0 ] ; then echo "class already existing; nothing is done" ; exit ; fi ;\ |
40 | tar xzf $class.tgz\ |
64 | tar xzf $class.tgz\ |