Opened 16 years ago
Last modified 7 years ago
#18952 assigned defect
Stray .TMP files on distfiles mirrors — at Initial Version
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | wsiegrist@… |
---|---|---|---|
Priority: | Low | Milestone: | |
Component: | server/hosting | Version: | |
Keywords: | Cc: | somaen@…, david@… | |
Port: |
Description
It seems that sometimes the distfiles mirror gets interrupted while downloading a file, and then a .TMP file gets left behind. This is a bit untidy and it would be nice if the .TMP files could be cleaned up automatically so that they don't appear when browsing the distfiles servers' directory listings.
Perhaps a cron task could be installed to periodically clean it up. For example, it could run this command:
find /path/to/distfiles -type f -name '*.TMP' \! -newermt '1 hour ago' -delete
This would find and delete files in /path/to/distfiles whose names end with ".TMP" and that were last modified more than an hour ago.
If you just want to see what files would be deleted without deleting them, remove "-delete
" from the command:
find /path/to/distfiles -type f -name '*.TMP' \! -newermt '1 hour ago'
The "1 hour" figure is picked a bit at random, but you want some nonzero value in there; you wouldn't want to clean up .TMP files that are currently being downloaded.