Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Consider this command: sudo incrontab ~/incron-config where ~/incron-config contains:

/home/zetah/Documents/incoming IN_CREATE,IN_MOVED_TO /home/zetah/scripts/do_something.sh $@/$#

and do_something.sh consists of:

#! /bin/bash

python /home/zetah/scripts/py_something.py "$1"

Python script accesses some online services and produces 3 new files. They are owned by root.
Why is that and how can I change this behavior. I want to be the owner of those product files

Thanks

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

By running incrontab under sudo, you are updating root's configuration. Therefore, your script is also run as root.

If you run incrontab without sudo, your script should be run under your own user account.

share|improve this answer
    
Thanks. I thought that running with sudo is the only way there is –  zetah Sep 5 '11 at 7:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.