Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trouble in using jointly with "find" and folders #10

Open
maccouch opened this issue Mar 22, 2015 · 0 comments
Open

trouble in using jointly with "find" and folders #10

maccouch opened this issue Mar 22, 2015 · 0 comments

Comments

@maccouch
Copy link

Hi. I'm having a problem using the "find" command and trash regarding folders. i have a simple script i call daily to remove folders and files older than 7 days. somehow, files get removed but folders are a hit or miss... Not sure if it is due to the way the command is written or if a bug. A Simple sample is attached below. I can use the same line with "rm -r" instead of trash and it works, but with trash, either through "trash -a" or "Trash" only, i've got this error, while simulatenously deleting the folder.

However, by calling this script through Crontab, i've noticed it not always deletes the folders, although i'm not sure why or when. Could you help me out?
Thanks

sh-3.2$  find /Users/Shared/01.Downloads/01.Downloaded_Apps_Folder  -mtime +4 -type d

/Users/Shared/01.Downloads/01.Downloaded_Apps_Folder/sysdiagnose_2015.03.17_12-01-19+0000_0/logs/asl/AUX.2015.03.16

/Users/Shared/01.Downloads/01.Downloaded_Apps_Folder/Vodafone Mobile Broadband 4.10.09.00.dmg-2.download

sh-3.2$  find /Users/Shared/01.Downloads/01.Downloaded_Apps_Folder  -mtime +4 -type d -exec /usr/local/bin/trash -a {} \; 2>&1

find: /Users/Shared/01.Downloads/01.Downloaded_Apps_Folder/sysdiagnose_2015.03.17_12-01-19+0000_0/logs/asl/AUX.2015.03.16: No such file or directory

find: /Users/Shared/01.Downloads/01.Downloaded_Apps_Folder/Vodafone Mobile Broadband 4.10.09.00.dmg-2.download: No such file or directory

sh-3.2$  find /Users/Shared/01.Downloads/01.Downloaded_Apps_Folder  -mtime +4 -type d

sh-3.2$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant