Skip to content

Commit

Permalink
Use BSD find instead of ZSH mv
Browse files Browse the repository at this point in the history
Reason for Change
=================
* Errors! The files wouldn't move and the logs looked confusing.
* Specifically, I got a lot of `zsh : no matches found` errors in the log, which I don't want since I run this script every minute.

Changes
=======
* Use BSD `find` and then `-exec` to `mv` files into the trash.
* Since this is OS X and zsh, we have to quote the curlies to make it work.
  • Loading branch information
adarsh committed Jan 9, 2017
1 parent 4852319 commit 308f0a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/clean_downloads
Expand Up @@ -7,4 +7,4 @@ setopt null_glob
# Move folders and files with an mtime (modification) older than 1 week to the
# trash folder.
# http://www.zsh.org/mla/workers/2011/msg01399.html
mv ~/Downloads/**/*(.mh+168) ~/.Trash/
find ~/Downloads/* -mtime +5 -exec mv '{}' ~/.Trash \;

0 comments on commit 308f0a6

Please sign in to comment.