From ed77852b378ed736358d131262f12a18fefc4a53 Mon Sep 17 00:00:00 2001 From: Conor Walsh Date: Sat, 10 Oct 2020 16:31:31 +0100 Subject: [PATCH] Script to keep the files on the server up to date --- update-renew-from-github.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 update-renew-from-github.sh diff --git a/update-renew-from-github.sh b/update-renew-from-github.sh new file mode 100644 index 0000000..affa435 --- /dev/null +++ b/update-renew-from-github.sh @@ -0,0 +1,20 @@ +#! /bin/sh -e + +# keep the files in renew up to date with git repo +# this script will be called from a cronjob every 7 days +# cwalsh 2020-10-10 + +# ensure we are in the correct directory +cd /var/www/renew + +# delete all files in directory except for this script +ls | grep -v update-renew-from-github.sh | xargs rm -rf -- + +# clone renew directory +git clone http://github.com/ULCompSoc/skynet.ie-renew.git + +# copy files from git repo to main directory +cp -r skynet.ie-renew/* . + +# remove the git repo from the directory +rm -rf skynet.ie-renew