I want to be able to run a cron job as the tomcat6 user. I tried to su tomcat6 but I don't know the default password for that user. Should I run them as tomcat6 (if I can find out the password - this is on Ubunbu 9.04) or run them as another user but grant the tomcat6 user access to the necessary files? If I do the second option, should I create a group and add tomcat6 to that as well as any other users that may need to run the script the cron job kicks off?
|
| |||
|
feedback
|
|
I'm not sure whether you've got root on this server or not, could you please clarify? It would seem you don't as you've been asked for a password, but on the other hand you mention creating a group, which in principle you could only do with root access of some kind. If you've got
Or edit tomcat6's crontab directly:
You could of course also add the job directly to the system crontab, remembering to use tomcat6 on the sixth column:
As for the rest, if this cronjob has to write to files belonging to different users I would probably use a dedicated group (say tomcat6 - check whether you have it already). Then, for each file in that set:
| |||
feedback
|