do shell script won't compile, but will run in terminal - Log files Q:

Right now I have a shell script that finds and stuffs [using stuffit command line utility] any folders residing inside of the folders “09_Client Original” and “12_Client Original” that are over 2 weeks old.

find /JobVolume/ ( -mtime +14 -type d -path ClientOriginal/* -exec /usr/local/bin/stuff -f sit5 -m 2 -o {} ; )

What I want to have happen is for this command to be executible via do shell script, but when I try to compile it, I get the following error: Expected " but found unknown token.

do shell script "find /JobVolume/ \( -mtime +14 -type d -path *Client*Original/* -exec /usr/local/bin/stuff -f sit5 -m 2 -o -D {} \; \) >>$HOME/Desktop/StuffitLog.txt" password "PASSWORD" with administrator privileges

Also, as a seperate issue, when including the option to output the results to a file, is there a way to append the output file with a date seperator?

Instead of:
Sample text result
Sample text result
Sample text result
Sample text result

Desired result:
Mon Jul 1 12:00:00 PDT 2006
Sample text result
Mon Jul 2 12:00:00 PDT 2006
Sample text result
Mon Jul 3 12:00:00 PDT 2006
Sample text result
Mon Jul 4 12:00:00 PDT 2006
Sample text result

Or, if that isn’t possible, output sequential results files such as “StuffitLog.txt_1”, “StuffitLog.txt_2”, etc?

Thanks in advance!

Just like a shell, AppleScript uses the backslash as an escape character; You’ll need to escape the backslashes you already have.

do shell script "find /JobVolume/ \\( -mtime +14 -type d -path *Client*Original/* -exec /usr/local/bin/stuff -f sit5 -m 2 -o -D {} \\; \\) >>$HOME/Desktop/StuffitLog.txt" password "PASSWORD" with administrator privileges

Ah! Thanks very much.

What I’ll probably do with the log file is setup postfix to e-mail it to me when the script is done executing instead of trying to append it.