summaryrefslogtreecommitdiff
path: root/examples/cron
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 13:59:18 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:22:26 +0100
commit56bb13cd0129cf97dd266441623c17c0fdd87f11 (patch)
treee950c610f9e4771a59a4232b6db0a473f4bb0640 /examples/cron
parentb1b3fc85abbe7e7cc0ce4d956c94527ddc2891a9 (diff)
downloadlive-build-56bb13cd0129cf97dd266441623c17c0fdd87f11.zip
live-build-56bb13cd0129cf97dd266441623c17c0fdd87f11.tar.gz
Only removing old packages if they exist.
Diffstat (limited to 'examples/cron')
-rwxr-xr-xexamples/cron/snapshots.sh11
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