Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-11-15 18:30:59 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-11-15 18:30:59 (GMT)
commitc5bd554f5fd5085b30b932452d3f9f111d8f4700 (patch)
treec257ec6a122761007c5b4734b78a8915423fd9c1
parent7930736bbd75e814d1464df3a00da5bca2fc45dd (diff)
Add cron tasks
-rwxr-xr-xaslo/cron/daily37
-rwxr-xr-xaslo/maintenance.sh40
2 files changed, 37 insertions, 40 deletions
diff --git a/aslo/cron/daily b/aslo/cron/daily
new file mode 100755
index 0000000..03dec67
--- /dev/null
+++ b/aslo/cron/daily
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+root=$(dirname $(dirname $(dirname $(readlink --canonicalize-missing $0))))
+
+cd $root/bin
+
+for time in now yesterday; do
+ for type in downloads updatepings; do
+ php -f parse_logs/parse_logs.php \
+ logs=$root/data/ \
+ temp=/tmp \
+ type=$type \
+ date=$(date --date=$time +%Y%m%d) \
+ geo=US v=v
+ done
+
+ date=$(date +%F -d $time)
+ php -f maintenance.php weekly $date
+ php -f maintenance.php global_stats $date
+ php -f maintenance.php collection_stats $date
+ php -f maintenance.php collection_subscribers $date
+done
+
+php -f maintenance.php total
+php -f maintenance.php ADU
+php -f maintenance.php gc
+#php -f maintenance.php publish_files
+php -f maintenance.php reviews
+php -f maintenance.php user_ratings
+php -f maintenance.php ratings
+php -f maintenance.php unconfirmed
+php -f maintenance.php expired_resetcode
+php -f maintenance.php addons_collections_total
+#php -f maintenance.php collections_total
+php -f maintenance.php collections_ratings
+php -f maintenance.php share_count_totals
+php -f maintenance.php category_totals
diff --git a/aslo/maintenance.sh b/aslo/maintenance.sh
deleted file mode 100755
index 6772dbc..0000000
--- a/aslo/maintenance.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-
-root=$(cd $(dirname $0)/..; pwd)
-logfile=$root/data/parse
-
-cd $root/bin
-
-date > $logfile
-
-for type in downloads updatepings; do
- php -f parse_logs/parse_logs.php \
- logs=$root/data/ \
- temp=/tmp \
- type=$type \
- date=$(date --date=yesterday +%Y%m%d) \
- geo=US v=v >> $logfile
-done
-
-for time in now yesterday; do
- date=$(date +%F -d $time)
- php -f maintenance.php weekly $date >> $logfile
- php -f maintenance.php global_stats $date >> $logfile
- php -f maintenance.php collection_stats $date >> $logfile
- php -f maintenance.php collection_subscribers $date >> $logfile
-done
-
-php -f maintenance.php total >> $logfile
-php -f maintenance.php ADU >> $logfile
-php -f maintenance.php gc >> $logfile
-#php -f maintenance.php publish_files >> $logfile
-php -f maintenance.php reviews >> $logfile
-php -f maintenance.php user_ratings >> $logfile
-php -f maintenance.php ratings >> $logfile
-php -f maintenance.php unconfirmed >> $logfile
-php -f maintenance.php expired_resetcode >> $logfile
-php -f maintenance.php addons_collections_total >> $logfile
-#php -f maintenance.php collections_total >> $logfile
-php -f maintenance.php collections_ratings >> $logfile
-php -f maintenance.php share_count_totals >> $logfile
-php -f maintenance.php category_totals >> $logfile