summaryrefslogtreecommitdiff
path: root/examples/cron
diff options
context:
space:
mode:
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 2075388c0..e9f97958d 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