FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > Utilities / Scripts / Software
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 11-29-2013, 05:24 PM   Postid: 183019
johnfl68
Site Owner
 
johnfl68's Avatar

Forum Notability:
975 pts: Dignified Competence!
[Post Feedback]
 
Join Date: Nov 2003
Location: Orlando, FL
Posts: 1,141
Cron jobs (Non FQ)

Hello:

Hopefully someone can help me understand best way to do this.

Here at FQ, I edit the Crontab (presumably as my user account) and the jobs (Perl Scripts) run fine.

I'm trying to do the same on a Ubuntu 13.10 Server, and having issues, and I think it is multiple things; root, users, group access, or combinations.

Scripts are in /home/johnb/scripts/ (755)
Website is in /var/www/ (765)
Cron jobs are run as johnb

Some files were not being written to /var/www/
I changed cronjobs to run as root - then files that weren't written are, but files that were already wrote, would not.

There were a mix of owners in /var/www/ so I changed them all back to root owner, several places on the web said this is best.

Also as suggested, I added a usergroup webmasters, and added user johnb to that, and added that group to /var/www/ which I think is a step in the right direction, but I am still having issues with scripts run as johnb not writing files to /var/www/

It's so much simple when the same user owns everything, but I understand the security issues.

So am I missing something here?

Does my user cron not have the same permissions as me?
If I am a member of the webmasters user group with write permissions, why can't my cron perl scripts write files to /var/www/ ?

I'm sure it's something simple, and I am just missing or misunderstand some little item.

If anyone has any thoughts on this, it would be appreciated.

Thanks.

John
__________________
Klaatu: I won't resort to threats, Mr. Harley. I merely tell you the future of your planet is at stake.
The Day the Earth Stood Still (1951)
johnfl68 is offline   Reply With Quote
Old 12-01-2013, 03:50 AM   Postid: 183022
oheso
Registered User

Forum Notability:
261 pts: An Honor To Be Around
[Post Feedback]
 
Join Date: May 2002
Location: Tokyo, Japan
Posts: 366
Re: Cron jobs (Non FQ)

It sounds like you're on the right track. Here are some things to check:

- Are you checking in the filesystem that the files are not present, or just looking for them via the web? If they are present in the filesystem but not being served, try changing the owner to apache.

- You say you added group webmasters to /var/www, but don't say what permissions you gave it. Does it have write permissions?

- When you added the above permissions, did you do it recursively for all subdirectories?

That's all that occurs to me off the top of my head. If you find the files are not being written (rather than just not appearing via the web), you should probably add logging to your cron job to see what the error message is.

My preference for files written to the /var/www directory would be to chown apache:apache after writing. This should help you if the files are being written but not appearing via the web. (Also check the permissions on the files, which should be 755 or similar.)
oheso is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 12:24 AM.


Running on vBulletin®
Copyright © 2000 - 2019, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2019 FutureQuest, Inc.
FutureQuest, Inc.