Yeah the script is running on a productiv Nextcloud in the testing phase i first tryed it with ls and after that i specified a folder in __groupfolders whitch could be deleted without worry of loosing something. The Script works fine like it is. Im going to try everything again with the ls. thx for your help
------ Post updated at 07:16 AM ------
thx man it is working you are top! You safed my day ;D
find "/usr/share/nextcloud/data/__groupfolders/28" -type f -mtime +14 ! -name "*.txt" -ls
The following operands are supported:
path A path name of a starting point in the directory hierarchy.
expression The first argument that starts with a -, or is a ! or a (, and all subsequent arguments are
interpreted as an expression made up of the following primaries and operators. In the descrip-
tions, wherever n is used as a primary argument, it is interpreted as a decimal integer
optionally preceded by a plus (+) or minus (-) sign, as follows:
+n more than n
n exactly n
-n less than n
-name pattern True if pattern matches the current file name. Normal shell file name generation characters
(see sh(1)) can be used. A backslash (\) is used as an escape character within the pattern.
The pattern should be escaped or quoted when find is invoked from the shell.
Unless the character '.' is explicitly specified in the beginning of pattern, a current
file name beginning with '.' does not match pattern when using /usr/bin/find.
/usr/xpg4/bin/find does not make this distinction; wildcard file name generation characters
can match file names beginning with '.'.