trigger a git commit for static site generator
klml
nginx-forum at nginx.us
Thu Aug 9 22:42:30 UTC 2012
Hi Justin,
thank you for this answer
> ... (and can be dangerous IMO):
> x="`tail -f /usr/local/nginx/logs/access.log |grep PUT |sed 's/["]//g'
|awk
> ....
using tail on logs for this is very freaky;) but its a thinkable
approach.
To get only PUT requests I used an extra PUT log in the nginx config:
if ($request_method = PUT) {
access_log /var/log/nginx/accessPUT.log;
}
so I dont need to grep.
Unfortunately I dont "get over" the forced tail
x="`tail -f /var/log/nginx/accessPUT.log`";
c="PUT" //to start an endless loop
while c="PUT"; //
do
echo $x;
#~ git commit -m "Hello Igor";
done
gave me noting, I expected the lines from the log.
At the moment I use, not-out-of-the-box;(, inotifywait but this works ;)
But I will think more about tail
http://stackoverflow.com/questions/420143/making-git-auto-commit
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,229477,229546#msg-229546
More information about the nginx
mailing list