diff options
author | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-05-15 18:05:36 +0200 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-05-15 18:05:36 +0200 |
commit | c544d99f907014a5f40356d79b9fb518b559372d (patch) | |
tree | b85d66e2e6dd45ae4acbf3a6f03ddc3b770bfc0a /cron-jobs/cleanup2.sh | |
parent | 39298cf09e2e88b1f6aec779170990675baf8992 (diff) | |
download | dbscripts-c544d99f907014a5f40356d79b9fb518b559372d.tar.gz dbscripts-c544d99f907014a5f40356d79b9fb518b559372d.tar.xz |
More cron job cleanup and fixes
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'cron-jobs/cleanup2.sh')
-rwxr-xr-x | cron-jobs/cleanup2.sh | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/cron-jobs/cleanup2.sh b/cron-jobs/cleanup2.sh deleted file mode 100755 index 4a79654..0000000 --- a/cron-jobs/cleanup2.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -usage() { - echo "Usage: $0 repo architecture" -} - -getpkgname() { - local tmp - - tmp=${1##*/} - tmp=${tmp%.pkg.tar.gz} - tmp=${tmp%-i686} - tmp=${tmp%-x86_64} - echo ${tmp%-*-*} -} - -FTPBASEDIR="/home/ftp" -FTPDIR=${FTPBASEDIR}/${1}/os/${2} -DBFILE=${FTPDIR}/${1}.db.tar.gz -OBSOLETEFILES="" - -if [ $# -lt 2 -o ! -f ${DBFILE} ]; then - usage - exit 1 -fi - -TMPDIR=$(mktemp -d /tmp/cleanup.XXXXXX) || exit 1 -cd ${TMPDIR} -tar xzf ${DBFILE} - -cd ${FTPDIR} -for pkgfile in *.pkg.tar.gz; do - pkgname="$(getpkgname ${pkgfile})" - for p in ${FTPDIR}/${pkgname}-*; do - if [ "$(getpkgname $(basename ${p}))" = "${pkgname}" ]; then - continue 2 - fi - done - OBSOLETEFILES="${OBSOLETEFILES} ${pkgfile}" -done - -cd - >/dev/null -rm -rf ${TMPDIR} - -echo -ne "DIRECTORY:\n${FTPDIR}\n\n" -echo -ne "OBSOLETEFILES:\n${OBSOLETEFILES}\n\n" |