QNAP NAS - kasowanie plików starszych niż n dni

0

Witam.

Czy używa ktoś z użytkowników NASa firmy QNAP?

Próbuję napisać skrypt usuwający pliki starsze niż n dni ale mi "nie idzie"...

Może e ktoś coś takiego robił?

Próbowałem wykorzystać find i xargs:
np. find /share/Download/* -mtime +5 | xargs rm
jednak, problemem są pliki zawierające spacje

szukając rozwiązania trafiłem na np.:
find /share/Download/* -mtime +5 | xargs -I{} rm -v {}
wtedy otrzymuje błąd:

xargs: invalid option -- 'I'
BusyBox v1.01 (2017.06.05-18:58+0000) multi-call binary

Usage: xargs [COMMAND] [OPTIONS] [ARGS...]

Executes COMMAND on every item given by standard input.

Options:
-r Do not run command for empty readed lines
-x Exit if the size is exceeded
-0 Input filenames are terminated by a null character
-t Print the command line on stderr before executing it.

0

find samo w sobie potrafi usuwać pliki, bodajże -delete lub -remove. Tylko porządnie przetestuj zanim odpalisz na produkcji :-P

0

No właśnie tu jest chyba jakaś inna wersja find:

[/] # find -h
BusyBox v1.01 (2017.06.05-18:58+0000) multi-call binary

Usage: find [PATH...] [EXPRESSION]

Search for files in a directory hierarchy.  The default PATH is
the current directory; default EXPRESSION is '-print'

EXPRESSION may consist of:
        -follow         Dereference symbolic links.
        -name PATTERN   File name (leading directories removed) matches PATTERN.
        -print          Print (default and assumed).

        -type X         Filetype matches X (where X is one of: f,d,l,b,c,...)
        -perm PERMS     Permissions match any of (+NNN); all of (-NNN);
                        or exactly (NNN)
        -mtime TIME     Modified time is greater than (+N); less than (-N);
                        or exactly (N) days

[/] #

1 użytkowników online, w tym zalogowanych: 0, gości: 1