Take the 2-minute tour ×  My first question, so be kind...
Basically, I have a folder that a user group has access to. This
folder has a program in it that runs as root(via sudo) then
outputs result files(xml files) to a subdirectory. Now, whenever
the command is run it outputs the results with ownership of
root(since that is who ran it). but i need any results created
to be automatically changed to be owned by the group who owns
the folder already. i tried using the setgid bit, but no luck.
Any ideas?  EDIT: just some extra info. The program MUST be run
as root. and i know i could set a cronjob or something, but i am
looking for a more elegant solution.  Thanks in advance
share|improve this question Don't run the program as root! – 
Michael Hampton Jan 26 '13 at 3:50 perhaps i should have
specified. The program MUST be run as root. –  rootchord Jan 26
'13 at 3:51 If it's not a stupid question, why must the files be
owned by the owner of the directory? If it's so others can read
them, that's got more to do