From c4bf838784ab123e93f66fbdfa3f81a9936f8d61 Mon Sep 17 00:00:00 2001 From: Adrian Amaglio Date: Wed, 28 Oct 2020 18:23:18 +0100 Subject: [PATCH] init --- Dockerfile | 9 +++++++++ main.sh | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Dockerfile create mode 100755 main.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ea4b8c4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM alpine + +WORKDIR /usr/src/app + +RUN apk add wget + +COPY ./main.sh . + +ENTRYPOINT [./main.sh] diff --git a/main.sh b/main.sh new file mode 100755 index 0000000..82d7077 --- /dev/null +++ b/main.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# todo parameters for website url or config file, copy dir, enabled git + +dest_dir="/data" +sourcefile="urls" +git_enabled=true + +wait_between=3600 + + +# This script watch for website in conf file and copy them statically in git repositories +mkdir -p logs +mkdir -p clones +cd clones + +while read -r line ; do + if [ -z "$line" ] ; then continue ; fi + wget -c -w 10 --random-wait -x -r "$line" > "../logs/$line/out.log" 2> "../logs/$line/err.log" & +done < "../$sourcefile"