1
2
How do I use the OS X at
command to schedule a daily clean-up of the user's .Trash
folder?
I'm thinking something along the lines of:
rm -rf ~/.Trash/**/* | at 0:00 + 1 day
Will this clean the trash every day?
We'll be running this command as part of a login script, so I also need a way to clear all the scheduled tasks. Is there a way to at -r all
?
1Is there any particular reason you want to use at vs cron/launchd? AT might not be better for this type of activity. – Eric G – 2013-02-25T03:34:43.240
Just so we can schedule it easily via a login script that runs every time the computer loads. Can we do this via cron? – Chris Nolet – 2013-02-25T03:37:44.113
The following question may be useful, if not, please let us know: http://superuser.com/questions/126907/how-can-i-get-a-script-to-run-every-day-on-mac-os-x
– Eric G – 2013-02-25T03:38:29.947Yep, saw that. Not sure how to flush the jobs though. Do they flush on reset? Likewise, I've seen different syntax in different places - just wondering what the latest one is. – Chris Nolet – 2013-02-25T03:43:38.657