summaryrefslogtreecommitdiff
path: root/cron-jobs/ftpdir-cleanup
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2008-05-29 15:34:49 -0400
committerAaron Griffin <aaronmgriffin@gmail.com>2008-05-29 15:34:49 -0400
commita90b2f5dc26474c291bd15b4bbddc75afea2731f (patch)
treec106bffb798c4ecd234673dc6e1b0879f9a6a8bd /cron-jobs/ftpdir-cleanup
parentfd921f8dc355ac51a8be843a4da052474b22700c (diff)
Add a real cron script to cycle over all repos
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'cron-jobs/ftpdir-cleanup')
-rwxr-xr-xcron-jobs/ftpdir-cleanup35
1 files changed, 35 insertions, 0 deletions
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
new file mode 100755
index 0000000..ce91b62
--- /dev/null
+++ b/cron-jobs/ftpdir-cleanup
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+#TODO add community
+repos="core extra unstable testing"
+arches="i686 x86_64"
+
+LOCKFILE="/tmp/.ftpdircleanup.lock"
+
+cleanup () {
+ rm -f "$LOCKFILE"
+ exit 0
+}
+
+ctrl_c() {
+ cleanup
+}
+
+if [ -f "$LOCKFILE" ]; then
+ owner="$(/usr/bin/stat -c %U $LOCKFILE)"
+ echo "error: source tarball generation is already in progress (started by $owner)"
+ exit 1
+fi
+
+trap cleanup 0
+trap ctrl_c 2
+
+/bin/touch "$LOCKFILE"
+
+for repo in $repos; do
+ for arch in $arches; do
+ $(dirname $0)/../misc-scripts/ftpdir-cleanup $repo $arch
+ done
+done
+
+cleanup