summaryrefslogtreecommitdiff
path: root/util/cron_daily.sh
diff options
context:
space:
mode:
Diffstat (limited to 'util/cron_daily.sh')
-rwxr-xr-xutil/cron_daily.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/util/cron_daily.sh b/util/cron_daily.sh
new file mode 100755
index 00000000..743a9839
--- /dev/null
+++ b/util/cron_daily.sh
@@ -0,0 +1,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`' ===';
+