-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcache-generate.sh
More file actions
executable file
·38 lines (34 loc) · 891 Bytes
/
cache-generate.sh
File metadata and controls
executable file
·38 lines (34 loc) · 891 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
35
36
37
38
#!/bin/bash
# (c) André Cianfarani <acianfa@gmail.com>
# Crawl websites for generating their caches.
#
if test -z "$1"
then
echo "first argument missing (domains to check file path)";
exit 1;
fi
sites=`cat $1 | grep -E -v '^(#|$)'`
tmp="/tmp/.cache-generate-tmpdownloads"
log="/tmp/cache-generate-"
# Remove the tmp directory's
rm -rf $tmp
# Crawl all domains found in the file
for site in $sites
do
echo "Crawling $site... "
logExt=$site'.log';
# Crawl the site
time wget \
--recursive \
--domains=$site \
--level=inf \
--directory-prefix=$tmp \
--force-directories \
--delete-after \
--output-file=$log$logExt \
--no-verbose \
http://$site/
echo "Logs are available here : $log$logExt"
done
# Remove the tmp directory's
rm -rf $tmp