Hello again, I am using the
The idea is to left inside the folder only the 3 last files.
I have this working on Linux, but for some reason its not working "-mtime +3", does not matter if I write +3 or +10, whatever it always shows the same amount of files. Anyone knows what could be wrong or another option to do this task? Thanks
find
to list an X amount of files and then deleting it. But I just want to delete the olders one so this is what I do:
Code:
find /mnt/text/ -maxdepth 1 -mtime +3 -name '*.gz'-execdir rm -- '{}' \;
The idea is to left inside the folder only the 3 last files.
I have this working on Linux, but for some reason its not working "-mtime +3", does not matter if I write +3 or +10, whatever it always shows the same amount of files. Anyone knows what could be wrong or another option to do this task? Thanks