Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am developing a automated system, which consists of 3 parts: mysql, bash and launchd. Bash script takes folders of work related stuff, zips, archives and puts info about them into database that is located on a local MAMP server. Everything works as expected when I run the script from terminal. But when I use Launchd to automatically run this script, it functions without errors and it does not put the values into database.

I've tried to make logs of returned messages, but the logs end up being empty as the command has run the way it was supposed to.

Any help would be appreciated!

.plist contents

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">






I made this .plist file just by searching the web.

As far as I understand the problem is in the launchd plist file. It somehow doesnt give the "range" to use mysql database.

share|improve this question
check permissions for lunchd to destination file/database/called script etc. try setting SUID for lunchd executable. – mnmnc Dec 18 '12 at 13:24
I guess i did not mention that I run this script as administrator and everything this script does, it does as adminstrator – Armandelis Dec 19 '12 at 12:56
When you run this manually you run it by admin and everything works. But when it runs automatically - are you sure it is running as administrator? – mnmnc Dec 19 '12 at 13:04
Well, how exactly should I verify that? For example when the script just makes a folder, and it is run by launchd, it shows that it was made by admin. – Armandelis Dec 19 '12 at 13:34
if the program is called launchd then use command watch -n1 'ps aux | grep launchd' this will check each second for launchd program and show you the user that started the command – mnmnc Dec 19 '12 at 13:39

You must log in to answer this question.

Browse other questions tagged .