Skip to content

Commit

Permalink
added scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcom committed Jul 24, 2009
1 parent d70249c commit 1260cd7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
4 changes: 4 additions & 0 deletions bin/block
@@ -0,0 +1,4 @@
#!/bin/bash
psql -c "update users set blocked='t' where id in (select id from users where score<-50 and nick!='anonymous' and max_score<150 and not blocked)" linux > /dev/null
psql -c "update users set blocked='t' where id in (select id from users where score<-50 and nick!='anonymous' and max_score<150 and blocked is null)" linux > /dev/null
psql -c "delete from users where not activated and regdate<CURRENT_TIMESTAMP-'1 week'::interval" linux > /dev/null
8 changes: 8 additions & 0 deletions bin/stat
@@ -0,0 +1,8 @@
#!/bin/bash

/usr/bin/psql -c "select stat_update()" linux >/dev/null
sleep 3
/usr/bin/psql -c "set sort_mem=10240; select stat_update2()" linux >/dev/null
sleep 3
/usr/bin/psql -c "select update_monthly_stats()" linux > /dev/null
/usr/bin/psql -c "select set_role_map()" linux > /dev/null
3 changes: 3 additions & 0 deletions bin/topstat
@@ -0,0 +1,3 @@
#!/bin/bash

/usr/bin/lynx -source http://www.linux.org.ru/_topstat.jsp > /dev/null
2 changes: 2 additions & 0 deletions bin/updatescore
@@ -0,0 +1,2 @@
psql -c "update users set score=score+1 where id in (select distinct comments.userid from comments, topics where comments.postdate>'yesterday' and topics.id=comments.topic and groupid!=8404 and groupid!=4068 and groupid!=19390 and not comments.deleted and not topics.deleted)" linux > /dev/null
psql -c "update users set max_score=score where score>max_score" linux > /dev/null
9 changes: 1 addition & 8 deletions install_www
Expand Up @@ -10,14 +10,7 @@ echo Copying files...
sudo cp -R dist/* /var/lib/tomcat5/webapps/lor
sudo touch /var/lib/tomcat5/webapps/lor/WEB-INF/web.xml

#sudo cp dist/*.jsp /var/www/linux.org.ru/servlets/
#sudo cp dist/WEB-INF/lib/*.jar /var/www/linux.org.ru/servlets/WEB-INF/lib/
#sudo cp -f dist/WEB-INF/urlrewrite.xml /var/www/linux.org.ru/servlets/WEB-INF/

#sudo cp -f -R html/* /var/www/linux.org.ru/html/
#sudo cp -f html/.htaccess /var/www/linux.org.ru/html/

#sudo /etc/init.d/resin restart
cp bin/* ~/bin/

echo done

0 comments on commit 1260cd7

Please sign in to comment.