phase1: dlprune: fix cannot delete ‘dl/’: Not a directory v7
authorPetr Štetiar <ynezz@true.cz>
Thu, 1 Jun 2023 05:56:49 +0000 (07:56 +0200)
committerPetr Štetiar <ynezz@true.cz>
Sat, 3 Jun 2023 07:45:45 +0000 (09:45 +0200)
dlprune currently fails with following error:

 find: cannot delete ‘dl/’: Not a directory

Initial idea was to delete only stuff under download directory and not
the download directory itself, so lets adjust the find command
accordingly.

Fixes: 68b20ed67b5e ("phase1: prune unused files from dl/")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
phase1/master.cfg

index 4fb28b63ca9ad82bee5ef520a11125ed2b2ccad3..91755cde6e932a88d4c2fa7cc15faee2c9a13479 100644 (file)
@@ -881,7 +881,7 @@ for target in targets:
                name = "dlprune",
                description = "Pruning dl/",
                descriptionDone = "dl/ pruned",
-               command = 'find dl/ -atime +15 -delete -print',
+               command = 'find dl/ -mindepth 1 -atime +15 -delete -print',
                logEnviron = False,
        ))