mirror of https://github.com/Chizi123/Scripts.git

Joel Grunbaum
2021-08-31 5ce9b0c04ee5b5e9dc5b2ae9b99a70a4857ae666
added boilerplate for cronjob
1 files modified
12 ■■■■■ changed files
hugo-sync.sh 12 ●●●●● patch | view | raw | blame | history
hugo-sync.sh
@@ -1,3 +1,5 @@
#!/bin/sh
REPO_DIR=$HOME/sites
SITE_DIR=repo
DEPLOY_DIR=/Eduardo/repo
@@ -5,14 +7,14 @@
cd $REPO_DIR/$SITE_DIR
# Check for repo update
if [[ -n $(git pull | grep 'Already up to date.') ]]; then
#    exit
    echo 1
if [ -n "$(git pull --ff-only | grep 'Already up to date.')" ]; then
    exit
fi
echo "Updating $SITE_DIR site"
# Build site
hugo
hugo 2>&1 >/dev/null
# sync new files across
rsync -av public/* $DEPLOY_DIR/
rsync -a public/* $DEPLOY_DIR/