I need to be able to run the cron jobs of rotating the log files, but with the admin name and password hard coded into the script (and saved as run only of course).
I need to do this because our users don’t have admin access nor can they use sudo.
This is the script I want to use but what is the syntax to hard code in the name and password?
-- show a list of choices and store the result(s) in the_choice
set the_choice to choose from list {"Daily", "Weekly", "Monthly"} with prompt "Select Maintenance Scripts:" with multiple selections allowed
-- if the user presses the "Cancel" button it returns false
if the_choice is not false then
-- perform appropriate tasks for each choice
-- the_choice would be something like {"Daily","Monthly"} depending upon what the user has chosen
if the_choice contains "Daily" then do shell script "sh /etc/periodic/daily/500.daily" with administrator privileges
if the_choice contains "Weekly" then do shell script "sh /etc/periodic/weekly/500.weekly" with administrator privileges
if the_choice contains "Monthly" then do shell script "sh /etc/periodic/monthly/500.monthly" with administrator privileges
-- Tell the user that all the tasks were successful
display dialog "Maintenance complete." buttons "OK" default button 1 giving up after 10
end if
is it something like “with username “baba” password “booey”?”
Thanks,
Chris