Results 1 to 3 of 3
Hi I've got an IPCam that I can pull a still image from. Everything works honky dory there. What I want to do is to automatically call a script to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-29-2006 #1
- Join Date
- Mar 2006
Newbie needs help with a bash script
I've got an IPCam that I can pull a still image from. Everything works honky dory there.
What I want to do is to automatically call a script to capture a frame everytime someone accesses my homepage.
I can get this to work, but my problem is that the script placed in my cgi-bin folder cannot write to the html folder where the script is called from.
This is probably very basic, but I cannot understand why my simple script cannot write to html folder.
It is obviously connected to permissions. It does work with cmod777 on the html folder, but I Don't want that. I've tried to add Apache to the group, but no go
Here is my script:
wget http://192.168.1.20:81/image.jpg --http-user=guest --http-passwd=
cp image.jpg still.jpg
I call it like this SSI: <!--#exec cmd="bash /mypath/cgi-bin/myscript.pl" -->
I get this errormessage
Connecting to 192.168.1.20:81... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5,178 [image/jpeg]
image.jpg: Permission denied
Cannot write to `image.jpg' (Permission denied).
cp: cannot stat `image.jpg': No such file or directory
rm: cannot remove `image.jpg': No such file or directory
Hope someone can help out a newbie, cause i'm getting really frustrated.
- 04-04-2006 #2
you could just give the file access rights of 777, that should overrule the folder's write permissions... thus allowing full write access to that file, and not the rest of the directory.
The other option is to chmod 755 the file, and then chown it to be the user that the script uses to write the file to the directory."I am not an alcoholic, alcoholics go to meetings"
Registered Linux user = #372327
- 04-11-2006 #3Originally Posted by sdousley