User write access
Moderator: General Moderators
- kbrown3074
- Forum Contributor
- Posts: 119
- Joined: Thu Jul 20, 2006 1:36 pm
User write access
I am having a problem with pages I am trying to have run thru a cron job. I can run the pages via the webpage itself, but thru a command line on the server it does not work. There is a similiar job running on a different directory and it works fine. The directory access is the same on both directories. Both directories only have root as the user. I know there is something Im missing..just not sure what to check.
- kbrown3074
- Forum Contributor
- Posts: 119
- Joined: Thu Jul 20, 2006 1:36 pm
My problem is that for some reason I cant get the new shell script to create files in the new directory. The existing script works fine and the directory has the same read/write attributes. I am getting the below error while trying to write to the directory thru the command line
Code: Select all
Can't create/write to file '/var/www/htdocs/daily_edts/sheets/2007_05_14_treeleads.txt' (Errcode: 2)what's the output of:
Code: Select all
ls -l /var/www/htdocs/daily_edts/sheets/2007_05_14_treeleads.txt- kbrown3074
- Forum Contributor
- Posts: 119
- Joined: Thu Jul 20, 2006 1:36 pm
output of:?
Code: Select all
ls -l /var/www/htdocs/daily_edts/sheets/- kbrown3074
- Forum Contributor
- Posts: 119
- Joined: Thu Jul 20, 2006 1:36 pm
Code: Select all
root@seq2:~# ls -l /var/www/htdocs/daily_reports/sheets
total 404
-rw-r--r-- 1 root root 9728 2007-05-13 06:55 aaasj2007-05-13.xls
-rw-r--r-- 1 root root 14848 2007-05-13 06:55 Cobra2007-05-13.xls
-rw-r--r-- 1 root root 5632 2007-05-13 06:55 confirmobleads2007-05-13.xls
-rw-r--r-- 1 root root 6144 2007-05-14 06:55 confirmobleads2007-05-14.xls
-rw-r--r-- 1 root root 11264 2007-05-10 09:15 cont66ib2007-05-10.xls
-rw-r--r-- 1 root root 12800 2007-05-13 06:55 cont66ib2007-05-13.xls
-rw-r--r-- 1 root root 21504 2007-05-13 06:55 cont66ob2007-05-13.xls
-rw-r--r-- 1 root root 4096 2007-05-13 06:55 cont66obleads2007-05-13.xls
-rw-r--r-- 1 root root 8704 2007-05-14 06:55 cont66obleads2007-05-14.xls
-rw-r--r-- 1 root root 4096 2007-05-13 06:55 cont66pt2007-05-13.xls
-rw-r--r-- 1 root root 5120 2007-05-14 08:14 cont66pt2007-05-14.xls
-rw-r--r-- 1 root root 39936 2007-05-13 06:55 dtree2007-05-13.xls
-rw-r--r-- 1 root root 12800 2007-05-13 06:55 gwoeib2007-05-13.xls
-rw-r--r-- 1 root root 20480 2007-05-13 06:55 gwoeob2007-05-13.xls
-rw-r--r-- 1 root root 4096 2007-05-13 06:55 gwoeobleads2007-05-13.xls
-rw-r--r-- 1 root root 4096 2007-05-14 06:55 gwoeobleads2007-05-14.xls
-rw-r--r-- 1 root root 4096 2007-05-13 06:55 gwoept2007-05-13.xls
-rw-r--r-- 1 root root 5120 2007-05-14 08:14 gwoept2007-05-14.xls
-rw-r--r-- 1 root root 13312 2007-05-13 06:55 ibcib2007-05-13.xls
-rw-r--r-- 1 root root 20480 2007-05-13 06:55 lifesec2007-05-13.xls
-rw-r--r-- 1 root root 12288 2007-05-13 06:55 ltcib2007-05-13.xls
-rw-r--r-- 1 root root 9216 2007-05-13 06:55 ltcny2007-05-13.xls
-rw-r--r-- 1 root root 21504 2007-05-13 06:55 ltcob2007-05-13.xls
-rw-r--r-- 1 root root 12288 2007-05-14 07:51 medsupib2007-05-14.xls
-rw-r--r-- 1 root root 21504 2007-05-14 07:51 medsupob2007-05-14.xls
-rw-r--r-- 1 root root 22528 2007-05-13 06:55 mhip2007-05-13.xls
-rw-r--r-- 1 root root 12800 2007-05-13 06:55 partdib2007-05-13.xls
-rw-r--r-- 1 root root 21504 2007-05-13 06:55 partdob2007-05-13.xls
root@seq2:~#ok, I'm going to assume that the directory itself is set for root:root 0644; which would prohibit any user but root from writing to that directory.
You can either change the group ownership to that of the same group as your webservers user and chmod to 0664, or chmod the directory to 0666 which will allow anyone to write (but not execute) the files - I recommend the former.
You can either change the group ownership to that of the same group as your webservers user and chmod to 0664, or chmod the directory to 0666 which will allow anyone to write (but not execute) the files - I recommend the former.
- kbrown3074
- Forum Contributor
- Posts: 119
- Joined: Thu Jul 20, 2006 1:36 pm
- kbrown3074
- Forum Contributor
- Posts: 119
- Joined: Thu Jul 20, 2006 1:36 pm
I guess I am completely missing the boat on this one. I thought there would be more than 1 group when I do a groups command..not the case. Seems like something simple to allow the root user to write files to this dir..but it still isnt working...ugh!
Code: Select all
root@seq2:/var/www/htdocs/daily_edts/sheets# groups
root
root@seq2:/var/www/htdocs/daily_edts/sheets#
root@seq2:/var/www/htdocs/daily_edts/sheets# users
root root
root@seq2:/var/www/htdocs/daily_edts/sheets#- kbrown3074
- Forum Contributor
- Posts: 119
- Joined: Thu Jul 20, 2006 1:36 pm
- kbrown3074
- Forum Contributor
- Posts: 119
- Joined: Thu Jul 20, 2006 1:36 pm