I'm trying to make a zip file of all the files in a specific directory which were modified in the last x minutes.
Here's my command:
find "/path/to/dir" -mmin -30 -not -name ".*" -exec zip -r "testfile.zip" "{}" \+
If I make the modify time small enough, then it correctly identifies the one file that I recently changed.
The problem is... if I increase the minimum modify time to, say, 50 (it keeps changing), then the zip file adds all of the files in /path/to/dir. Even though all the files were definitely not changed.
So somehow, there is a specific file that is causing the whole find command to blow up. I looked through all the recently modified files (within last day) for a file with spaces in it or something, but I didn't find any. And it shouldn't matter, since I'm quoting the braces, right?
What else could be causing this weird behavior?
-not -type d
in there so thatfind
won't match the directory itself.