-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathclearDispatcherCache.sh
More file actions
34 lines (28 loc) · 864 Bytes
/
clearDispatcherCache.sh
File metadata and controls
34 lines (28 loc) · 864 Bytes
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
#!/bin/bash
if [ "$1" == "" -o "$2" == "" ]; then
echo "usage: use 'ls' to list files, 'rm' to remove them for first parameter"
echo "usage: add domain path in second parameter"
echo "e.g : ./clearCacheScript ls projectx"
exit
elif [ "$1" == "ls" ]; then
export cmd='find -regex ".*\.\(html\|css\|jpg\|js\|gif\|png\|json\|zip\)"'
elif [ "$1" == "rm" ]; then
export cmd='find -regex ".*\.\(html\|css\|jpg\|js\|gif\|png\|json\|zip\)" -delete'
fi
echo $cmd
export dir="/mnt/var/www/etc/clientlibs/"$2
echo '*******Deleting files in' $dir
cd $dir;
eval $cmd;
export dir="/mnt/var/www/etc/designs/"$2
echo '*******Deleting files in' $dir
cd $dir;
eval $cmd;
export dir="/mnt/var/www/content/dam/"$2
echo '******Deleting files in' $dir
cd $dir;
eval $cmd;
export dir="/mnt/var/www/content/"$2
echo '******Deleting files in' $dir
cd $dir;
eval $cmd;