update.sh (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#!/usr/bin/env bash
lastmodfile="$(find /web/petermolnar.net/petermolnar.net/ -maxdepth 2 -type f -print0 | xargs -0r ls -ltr | grep -E '(content|comments|copy|files|offlinecopies|photos)' | tail -1 | awk '{print $9}')"
lastmod=$(stat -c %Y "$lastmodfile")
lastrunfile="/web/petermolnar.net/petermolnar.net/build/magic.php"
lastrun=$(stat -c %Y "$lastrunfile")
if [ "$lastrun" -lt "$lastmod" ]; then
cd /web/petermolnar.net/petermolnar.net/nasg; python3.5 nasg.py --loglevel info
fi
exit 0
|