-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemptyScans.sh
executable file
·37 lines (29 loc) · 1006 Bytes
/
emptyScans.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
##################################################################
# extract from
# smb_workspace.conf
# the paths where any potential scan directories would be placed
# and check each with tmpwatch
##################################################################
# modified on: 2012-08-26
# modified by: Garry Thuna
##################################################################
gtToolDir=${0%/*}
eval "`$gtToolDir/ldapConf.py \
SAMBA_ROOT \
SAMBA_WORKSPACE \
SAMBA_WORKSPACE_CONF \
`"
##################################################################
#
##################################################################
idleMins=${1:-90}
cat $SAMBA_ROOT/$SAMBA_WORKSPACE_CONF | \
grep -i "$SAMBA_WORKSPACE/.*/scans/" | \
awk '{print $3}' | \
while read dir; do
echo ========== process: $dir
if [ -d "$dir" ]; then
tmpwatch -c ${idleMins}m "$dir"
fi
done