summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@dev.spline.de>2008-08-28 18:11:26 +0200
committerroot <root@dev.spline.de>2008-08-28 18:11:26 +0200
commit43cad154aaa7778b51b884b24147b51656ae3596 (patch)
tree1027be73a9ec83cd4812444541c5be17f726dbdd
parentd712a8a289885ca242b0de173535ab6ded2a833c (diff)
downloaddev-scripts-43cad154aaa7778b51b884b24147b51656ae3596.tar.gz
dev-scripts-43cad154aaa7778b51b884b24147b51656ae3596.tar.xz
dev-scripts-43cad154aaa7778b51b884b24147b51656ae3596.zip
two new cronscripts
-rwxr-xr-xbin/check_project_backups28
-rwxr-xr-xbin/check_registrations28
2 files changed, 56 insertions, 0 deletions
diff --git a/bin/check_project_backups b/bin/check_project_backups
new file mode 100755
index 0000000..928a1ed
--- /dev/null
+++ b/bin/check_project_backups
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+dbquery() {
+ mysql -s -s -e "$*" trac
+}
+
+# main function
+main() {
+ find /var/www/localhost/htdocs/backup/ -mindepth 1 -maxdepth 1 -ctime 7 | xargs rm -rf
+}
+
+# go to script dir
+pushd $(dirname $0) > /dev/null
+
+# get global functions
+source "./functions.sh"
+
+# load configuration
+source "./config.sh"
+
+# exit on errors
+set -e
+
+# start main program
+main "$@"
+
+# leave script dir
+popd > /dev/null
diff --git a/bin/check_registrations b/bin/check_registrations
new file mode 100755
index 0000000..cc48d4a
--- /dev/null
+++ b/bin/check_registrations
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+dbquery() {
+ mysql -s -s -e "$*" trac
+}
+
+# main function
+main() {
+ dbquery("delete from user where activated = 0 and adddate(date_added,7) < curdate()")
+}
+
+# go to script dir
+pushd $(dirname $0) > /dev/null
+
+# get global functions
+source "./functions.sh"
+
+# load configuration
+source "./config.sh"
+
+# exit on errors
+set -e
+
+# start main program
+main "$@"
+
+# leave script dir
+popd > /dev/null