Saturday, July 4, 2020

#1 2002-05-08 03:26:43 am

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

How do I script this on my OS X server?

I have setup a shared in/outbox partition and folder on my server to be shared around a number of final cut pro labs.
I wish to create an applescript which will automatically delete the contents of that shared folder at midnight everynight so that users cannot store their crap there and just use the in/out box to share files to other machines on the network.
Can anyone suggest a script that would achieve this or perhaps a URL where such a script may already exist, so we can tweak it!
HELP PLEASE....


One mans trash is another mans treasure

Offline

 

#2 2002-05-08 06:06:42 am

T.J. Mahaffey
Administrator
From:: Arkansas, USA
Registered: 2002-11-20
Posts: 238
Website

Re: How do I script this on my OS X server?

First, download "Cronnix". This is a freeware application which puts a GUI face on the Unix stand-by scheduling process called "cron".
Next create a script which goes something like:

Applescript:

set theSharedFolder to alias "00X:Junk Drawer:Test Folder:"

Note:
the above is a reference to a folder on my Powerbook's hard drive, which is called "00X". So, -- This is folder "Test Folder" of folder "Junk Drawer" of disk "00X" -- Thanks to Script Debugger, I'm able to just drag a folder into my script window and it will -- automatically give me the necessary path to that folder. SD rules.

Applescript:

tell application "Finder"
   delete every item in theSharedFolder
   empty trash
end tell


T.J.
tj@tjmahaffey.com


Filed under: Finder

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)