Add safeguards to cron job so that website does not get deleted without having replacement files.

This commit is contained in:
2025-08-17 09:12:23 -07:00
parent dbb54b6f81
commit ddeadcf723

View File

@@ -2,9 +2,10 @@
cd /var/www/hugo/site
git pull
hugo --gc --minify
git pull && hugo --gc --minify
status="$?"
if [[ $status == 0 && -e public/* ]]; then
rm -rfv /var/www/html/*
cp -rfv public/* /var/www/html/
mv -rfv public/* /var/www/html/
fi