summaryrefslogtreecommitdiff
path: root/util/OLD/cron_daily.sh
blob: 743a9839410c0a687ba8329616b135d0d06ec9ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

# we want to run as user 'yorhel'
if [ `id -nu` != 'yorhel' ]; then
  su yorhel -c "$0"
  exit;
fi

cd /www/vndb/util

SQL='psql -e vndb -U vndb';

echo '

   =================================================================================
=================== VNDB cron running at '`date`' ==================
=== Executing SQL statements'
echo '\timing
\i cron_daily.sql' | $SQL

echo '=== Creating/updating sitemap';
./sitemap.pl
#echo '=== Cleaning up images';
#./cleanimg.pl
#echo '=== Creating relation graphs';
#./relgraph.pl
echo '=== VACUUM FULL ANALYZE';
vacuumdb -U yorhel --full --analyze vndb  >/dev/null 2>&1

echo '=== VNDB cron finished at '`date`' ===';