From 7a2109fe8645eae4bc0024c057d399d67e0f0035 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 17 Jul 2009 12:47:59 -0700 Subject: ftpdir-cleanup: Allow configurable destination dir 3rd argument to the script Signed-off-by: Aaron Griffin --- misc-scripts/ftpdir-cleanup | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'misc-scripts/ftpdir-cleanup') diff --git a/misc-scripts/ftpdir-cleanup b/misc-scripts/ftpdir-cleanup index fbf2925..fd771e7 100755 --- a/misc-scripts/ftpdir-cleanup +++ b/misc-scripts/ftpdir-cleanup @@ -1,12 +1,13 @@ #!/bin/bash -if [ $# -ne 2 ]; then - echo "usage: $(basename $0) " +if [ $# -ne 3 ]; then + echo "usage: $(basename $0) " exit 1 fi reponame=$1 arch=$2 +dest=$3 ##### Arch specific stuff. TODO make this configurable ##### ftppath="/srv/ftp/$reponame/os/$arch/" @@ -98,7 +99,7 @@ echo "Scan complete for $reponame ($arch) at ${ftppath}" if [ -n "$DELETEFILES" ]; then echo " The following files are out of date" - echo " They will be moved to /srv/package-cleanup" + echo " They will be moved to '$dest'" for f in $DELETEFILES; do echo " $f" done @@ -115,7 +116,7 @@ fi if [ -n "$EXTRAFILES" ]; then echo " The following files are in the repo but not the db" - echo " They will be moved to /srv/package-cleanup" + echo " They will be moved to '$dest'" for f in $EXTRAFILES; do echo " $f" done @@ -124,25 +125,25 @@ fi if [ -n "$ARCHINDEPFILES" ]; then echo " The following architecture independent packages" echo " are not symlinked in the architecture repositories." - echo " They will be moved to /srv/package/cleanup" + echo " They will be moved to '$dest'" for f in $ARCHINDEPFILES; do echo " $f" done fi if [ -n "${DELETEFILES}" ]; then - mv ${DELETEFILES} /srv/package-cleanup/ + mv ${DELETEFILES} "$dest" echo "" fi if [ -n "${EXTRAFILES}" ]; then - mv ${EXTRAFILES} /srv/package-cleanup/ + mv ${EXTRAFILES} "$dest" echo "" fi cd "$ftppath_base/any" if [ -n "${ARCHINDEPFILES}" ]; then - mv ${ARCHINDEPFILES} /srv/package-cleanup/ + mv ${ARCHINDEPFILES} "$dest" echo "" fi -- cgit v1.2.3-2-g168b