diff options
author | Daniel Baumann <daniel@debian.org> | 2007-09-23 13:59:18 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 18:22:26 +0100 |
commit | 56bb13cd0129cf97dd266441623c17c0fdd87f11 (patch) | |
tree | e950c610f9e4771a59a4232b6db0a473f4bb0640 | |
parent | b1b3fc85abbe7e7cc0ce4d956c94527ddc2891a9 (diff) | |
download | live-build-56bb13cd0129cf97dd266441623c17c0fdd87f11.zip live-build-56bb13cd0129cf97dd266441623c17c0fdd87f11.tar.gz |
Only removing old packages if they exist.
-rwxr-xr-x | examples/cron/snapshots.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/cron/snapshots.sh b/examples/cron/snapshots.sh index 2075388..e9f9795 100755 --- a/examples/cron/snapshots.sh +++ b/examples/cron/snapshots.sh @@ -84,10 +84,13 @@ do mkdir -p "${SERVER}" # Removing old packages - for FILE in `awk {'print $5'} "${SERVER}"/"${PACKAGE}"*.changes | grep -e ".*\.deb$" -e ".*\.diff.gz$" -e ".*\.dsc$" -e ".*\.tar.gz$" -e ".*\.udeb$"` - do - rm -f "${SERVER}"/"${FILE}" - done + if [ -f "${SERVER}"/"${PACKAGE}"*.changes ] + then + for FILE in `awk {'print $5'} "${SERVER}"/"${PACKAGE}"*.changes | grep -e ".*\.deb$" -e ".*\.diff.gz$" -e ".*\.dsc$" -e ".*\.tar.gz$" -e ".*\.udeb$"` + do + rm -f "${SERVER}"/"${FILE}" + done + fi rm -f "${SERVER}"/"${PACKAGE}"*.changes |