Hi all, I'm actually having an issue with a script I have to make. I first try commands before making the script and even with commands it doesn't work.
By the way sorry for my english, I'm french.
I have to delete on a ReadyNAS Pro directories that are older than X days. I've checked and "mtime" seems to be the best way to found them.
Easy way... However, whatever I try it doesn't work.
First I had issues with the spaces in the name. When I tried to resolve it, I have an error in find must precede expression...
I tried aproximately 15 differents syntaxes that i found on the web, but none worked as I wanted.
Here is my current command:
find /c/home/test/D/ -maxdepth 1 -type d -mtime +3 print0 | xargs -0 rm -r >> /c/home/test/log/delete 2>> /c/home/test/log/errordel
In my final script I will replace full paths with variable.
What is wrong with that command?
I've been working on that since 3 days without succeding in anything..
Thanks in advance.
Edit: I didn't check on the forum if someone else had this issue because after all my search on web I really don't know where came from my probleme.