Running shell script with admin privileges

Hi All,

I have been using

do shell script “rsyncPath options path1 path2 etc.” password myPassword with administrator privileges

to run rsync in background with admin privileges to copy a disk to another local disk.

It has worked great but now in ASOC I am getting requests for password from the system after a while.

Has anyone else noticed this? I am wondering if there is a better way by using NSTask and run with privileges that way. Looking at various online topics and the docs for Authorization services though, it seems very complicated.

Any thoughts in this direction appreciated.

Rob

Is this the only command you need to run as privileged user, if thats the case you could just use Cocoa’s

AuthorizationExecuteWithPrivileges();

Isn’t that a C function (and hence out of the reach of ASObjC)?

I was thinking something along the lines of privileging his app using Obj-C (not 100% sure if thats possible but worth looking into) then have everything else be handled with ASOBJC.