Remove folder contents automatically every night in OSX
Posted on 2012-03-12
I would like some help with removing a folders contents once every night automatically on an osx server.
Lets call the folder "level1". This folder is located on my firewire drive named "MAC". So the path is /Volumes/MAC/level1
I only want to remove its contents(files & folders) but want to keep the folder level1.
So the terminal command would look like this: rm -rf /Volumes/MAC/level1/*
I heard I could add it to com.apple.periodic-daily.plist but I dont understand how to add it. Should I make a script and add the script to com.apple.periodic-daily.plist or is it possible to just add the command in there somehow?
If you think im going the wrong way and know of a better way to do this please tell..