Opened 12 years ago

Last modified 4 years ago

#18952 assigned defect

Stray .TMP files on distfiles mirrors

Reported by: ryandesign (Ryan Schmidt) Owned by: admin@…
Priority: Low Milestone:
Component: server/hosting Version:
Keywords: Cc: somaen@…, david@…, larryv (Lawrence Velázquez), mojca (Mojca Miklavec)

Description (last modified by mojca (Mojca Miklavec))

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.

See also #44789.

Change History (9)

comment:1 Changed 10 years ago by ryandesign (Ryan Schmidt)

Could this script be implemented? It would be nice to clean up the distfiles directories, and it should be just as simple as the one-liner already provided in the ticket description.

comment:2 Changed 7 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added

Cc Me!

comment:3 Changed 6 years ago by jmroot (Joshua Root)

Owner: changed from wsiegrist@… to admin@…

comment:4 Changed 5 years ago by ryandesign (Ryan Schmidt)

Owner: changed from admin@… to admin@…
Status: newassigned

comment:5 Changed 5 years ago by mojca (Mojca Miklavec)

Cc: mojca added

comment:6 Changed 5 years ago by mojca (Mojca Miklavec)

One further suggestion:

  • I believe that rsyncd can be configured not no serve certain files
  • Apache can be tricked into hiding certain files as well

So even if those files do show up, they still won't be visible (and ideally not even transferred to other mirrors). Running a cleanup is still a good idea.

comment:7 Changed 5 years ago by ryandesign (Ryan Schmidt)

Yes, rsyncd and httpd can be configured in the way you suggest. But I don't see any need to do so.

The new distfiles mirroring script, which I want to deploy soon, will not create .TMP files.

Once that script is deployed, I will remove the existing .TMP files.

comment:8 Changed 5 years ago by mojca (Mojca Miklavec)

Description: modified (diff)

comment:9 Changed 4 years ago by ryandesign (Ryan Schmidt)

I've done a one-time removal of .TMP files from the distfiles server. Once mirroring is set up again (#53347) we should make sure that we don't preserve .TMP files.

Note: See TracTickets for help on using tickets.