>> пока думаю заюзать find
>
> dir=/path/to/target
> find $dir -type f -mtime +30 ! \( -name "*-0*-01.*.tar.bz2"
> -o -name "*-0*-15.*.tar.bz2" \) -delete
> find $dir -type f -mtime +180 ! -name
> "*-0*-01.*.tar.bz2" -delete
> -delete не заработала, несмотря на:
-delete
Delete found files and/or directories. Always returns true.
This executes from the current working directory as find recurses
down the tree. It will not attempt to delete a filename with a
``/'' character in its pathname relative to ``.'' for security
reasons. Depth-first traversal processing is implied by this
option. Following symlinks is incompatible with this option.
Пришлось, через " -exec rm -rf {} \;" удалять
dir=/path/to/target
find $dir -type f -mtime +30 ! \( -name "*-0*-01.*.tar.bz2" -o -name "*-0*-15.*.tar.bz2" \) -exec rm -rf {} \;
find $dir -type f -mtime +180 ! -name "*-0*-01.*.tar.bz2" -exec rm -rf {} \;