Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Susja

macrumors regular
Original poster
Feb 22, 2017
199
7
Hello Folks,
I have quite a simple Task. I want to automatically delete all files from Download folder except for the current day.
I thought that I could use Automator. I looked in basic steps and created the Task.
I noticed 2 issues:
1. from all conditions Automator offers in Action 'Filter Finder Items' I did not find the one I was looking for. I was looking for something like 'Date added before 'today'. I did not find any 'condition' for 'added'. Hence, I selected 'Data created' + 'is before' + current date. It should work for today ... but how about tomorrow and other days?
Does anyone know how to compile this Task for Automator?
2. second and 'weird' issue was that it was working but very inconsistent. I mean that when I tested it and moved some 'old' files ... it moved it to Trash sometimes but did not do it always. That's weird. I have no clue why it's so inconsistent ..
Could anyone share their experience?

Thanks
 

Susja

macrumors regular
Original poster
Feb 22, 2017
199
7
Thank you ,
will try
@kryten2
- I gave up Automator because it didn't work me.
I was able to create a bash script (I used find command) that does what I want i.e. delete 'old' files but it failed to run in crontab. Error in crontab points me that the issue is that I have Standard account while I have to provide Full disc access ... anyway: now I have a valid script, but I can't schedule it in crontab.
Do you have other suggestion how to schedule the script?

Thanks
 

bogdanw

macrumors 603
Mar 10, 2009
6,099
3,011
Would’t this Folder Action work? Filter Finder items – None – Date last modified – is today
Folder_Action.jpg
 

Susja

macrumors regular
Original poster
Feb 22, 2017
199
7
Folks,
thanks for suggestions… but in my case Automator doesn’t work for any action.
when I tried run some simple action like 'echo' it also failed. Troubleshooting pointed me that my account does not have expected permissions
I tried crontab but it also didn’t work… again due to the lack of permission
for now only bash script works as I need… but I don’t have a mechanism to schedule it
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.