Last change
on this file since 33679 was 33679, checked in by davidb, 4 years ago |
Folder for working on updates (PDFs to del, PDFs to add) from Kiri
|
-
Property svn:executable
set to
*
|
File size:
1.2 KB
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 |
|
---|
4 | argc=$#
|
---|
5 |
|
---|
6 | if [ $argc != "1" ] ; then
|
---|
7 | echo "******" >&2
|
---|
8 | echo " Usage: $0 yyyy-mm-dd" >&2
|
---|
9 | echo "******" >&2
|
---|
10 | exit
|
---|
11 | fi
|
---|
12 |
|
---|
13 |
|
---|
14 | batch=${1%/}
|
---|
15 | pdf_del_dir="$batch/Pdfs-To-Delete"
|
---|
16 |
|
---|
17 |
|
---|
18 | if [ ! -d $pdf_del_dir ] ; then
|
---|
19 | echo "******" >&2
|
---|
20 | echo "Failed to find $pdf_del_dir" >&2
|
---|
21 | echo "******" >&2
|
---|
22 | exit
|
---|
23 | fi
|
---|
24 |
|
---|
25 |
|
---|
26 | echo "Processing PDFS in $batch"
|
---|
27 |
|
---|
28 | procdate=`date`
|
---|
29 | echo "$procdate: Processing PDFS in batch directory $batch" >> NOT-REDACTED.log
|
---|
30 |
|
---|
31 | for f in $pdf_del_dir/*.pdf ; do
|
---|
32 | localf=${f##*/}
|
---|
33 | # echo "Looking for: $localf"
|
---|
34 |
|
---|
35 | lines=$(find IMPORT/ -name "$localf" -print | wc -l)
|
---|
36 |
|
---|
37 | if [ $lines -eq 0 ]; then
|
---|
38 | # Look to see if it is in the REDACTED/batch area
|
---|
39 | # If it is, then it *did* exist, and in fact we have already processed it!
|
---|
40 | # => no need to print out warning in that case
|
---|
41 | lines=$(find REDACTED/$batch -name "$localf" -print | wc -l)
|
---|
42 | if [ $lines -eq 0 ] ; then
|
---|
43 | echo " Failed to find: $localf" >&2
|
---|
44 | echo "$localf" >> NOT-REDACTED.log
|
---|
45 | fi
|
---|
46 |
|
---|
47 | else
|
---|
48 | match=$(find IMPORT/ -name "$localf" -print)
|
---|
49 | echo "Moving \"$match\" -> \"REDACTED/$batch/.\""
|
---|
50 | mv "$match" "REDACTED/$batch/."
|
---|
51 | fi
|
---|
52 | done
|
---|
53 |
|
---|
54 | echo ""
|
---|
55 | echo "Logged failed to find message(s) to:"
|
---|
56 | echo " NOT-REDACTED.log"
|
---|
57 | echo ""
|
---|
58 |
|
---|
59 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.