My name is Mud
asked on
Crontab problem...
I don't know how to start... don't know why is happening... but here it goes...
I have set up webcam on linux, and I wanted to automate the process, so I found a page with two files one to stop the webcam and the other to start it, to be on the safe side it should be run at midnight pss some minutes.. using crontab...
ok if I run the program from the console, the images are created with 664 permissions wich that's what I want and it should be, since the program is executed by the user and it is in the user bin folder /home/user/bin and images are stored in a user's folder /home/user/pics
but if I set up cron...
crontab -u user -e
<vars>
<whatever>
<path add path to bin's user> {either this or...}
* * * * * /home/user/bin/webcamstart {this is the same I think and both are declared}
Why cron thinks like the executor is root??? or why does it change it from 664 to 644???
I hope I made my self clear...
I have set up webcam on linux, and I wanted to automate the process, so I found a page with two files one to stop the webcam and the other to start it, to be on the safe side it should be run at midnight pss some minutes.. using crontab...
ok if I run the program from the console, the images are created with 664 permissions wich that's what I want and it should be, since the program is executed by the user and it is in the user bin folder /home/user/bin and images are stored in a user's folder /home/user/pics
but if I set up cron...
crontab -u user -e
<vars>
<whatever>
<path add path to bin's user> {either this or...}
* * * * * /home/user/bin/webcamstart
Why cron thinks like the executor is root??? or why does it change it from 664 to 644???
I hope I made my self clear...
ASKER
oh and puting manually the comands in crontab did work with the same results as root...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Don't set umask in crontab. Set permissions in the script.
ASKER
Thanks to both...
ASKER
* * * * * user /home/user/bin/webcamstart
This is the real cronfile for user...
SHELL=/bin/sh
HOME=/home/user
PATH=/usr/bin:/bin:/home/u
LOGNAME=user
USER=user
02 00 * * * /home/user/bin/webcamstop
03 00 * * * /home/user/bin/webcamstart
06 00 * * * /home/user/bin/mkmovie
* * * * * /home/user/bin/createmask
Webcamstart starts the webcam and all images are 644 instead of 664 as well as mkmovie which starts the mencoder to create a movie out of the files from yesterday folder... and again, movie is 644 instead of 664... so what am I doing wrong???