summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2019-12-21 14:14:21 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2019-12-21 14:14:21 -0800
commit643d49037cb3a7f8baf8dcbbe71e922acab92e9a (patch)
tree4f7b2993a6645ce547fa6c5918ba05d62e8b9d85
parentsnapshots-create.sh: minor readability improvement (diff)
downloadmastermirror-scripts-643d49037cb3a7f8baf8dcbbe71e922acab92e9a.tar.gz
mastermirror-scripts-643d49037cb3a7f8baf8dcbbe71e922acab92e9a.tar.bz2
mastermirror-scripts-643d49037cb3a7f8baf8dcbbe71e922acab92e9a.zip
snapshots-create.sh: improve cleanup code
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xsnapshots-create.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/snapshots-create.sh b/snapshots-create.sh
index c54c5a9..3a8864b 100755
--- a/snapshots-create.sh
+++ b/snapshots-create.sh
@@ -354,12 +354,14 @@ write_time_log "END SYMLINK $(date -u)"
write_time_log "START CLEANUP $(date -u)"
cd "${TEMP}"
rm -f orig \
- ${FILENAME%.bz2} \
- ${FILENAME_NEW%.xz} \
- "${FILENAME}".umd5sum \
- "${FILENAME_NEW}".umd5sum \
+ "${FILENAME%.bz2}"{.bz2,.xz}{,.umd5sum} \
+ "${FILENAME_NEW%.xz}"{.bz2,.xz}{,.umd5sum} \
|| exit $?
-/usr/bin/find ${UPLOAD} -maxdepth 1 -mtime +${HISTORY} -type f | /usr/bin/xargs /bin/rm -f
+/usr/bin/find "${UPLOAD}" \
+ -maxdepth 1 \
+ -type f \
+ -mtime +${HISTORY} \
+ -delete
write_time_log "END CLEANUP $(date -u)"
# end 7)