I'm confused - Crontab and Access Permissions
Wondering if you can help me.
I have a crontab under the username admin. which is: 30 8 * * * admin echo "Contacting blahblah cgi remindme program" 30 8 * * * admin open www.blahblah.com/cgi-bin/remindme.cgi 5 * * * * admin /usr/local/bin/dhcpSMS.py Silly questions maybe, but I need to know. -Does the particular user need to be logged in for the crontab/s to work? -Hopefully I have the syntax correct for opening a website. (to activate the script to trigger a cgi program)? -Lastly the last line triggers a python script (new ip, e-mail script) It needs access permissions to access certain commands in the scripts. i.e. ifconfig So it doesn't work. I have given admin access rights ( "0" root) But now admin login doesn't detect the crontab since it doesn't crontab under root. I am confused now. Thanks for any help, directing to any of the questions. Have a good day! Neil |
Re: I'm confused - Crontab and Access Permissions
Quote:
Quote:
Quote:
Quote:
|
"Me too, lovely state of mind."
Thanks for making me laugh needed that. -So, each line I can just use "*" instead of a particular user. I tried running the e-mail ip script manually. It worked. But crontab doesn't run want to run it. Thought it was down to access rights. Will try * instead of user . Hopefully that will work. -I'm trying to find a command to open a webpage virtually. To trigger the cgi program. (No GUI) No luck so far in finding a command which will work. (I did just edit passwd manually) Thanks for helping out. Neil |
Editing the passwd file manually is a tricky process. If you changed your UID, then you have to change all your files in your home directory, your crontab, and any other files that you own to match the new UID. I highly recommend _not_ using this approach. If you need UID 0 rights, then use a package like sudo or run the cron job from root's crontab.
The crontab has no field for the user that the script is suppose to run as, so you need to remove that entirely. Try the following. (*again, I have never used the 'open' command, so I don't know if it will work) Code:
30 8 * * * echo "Contacting blahblah cgi remindme program" Code:
30 8 * * * echo "Contacting blahblah cgi remindme program" Then you could also change your UID back to a non-zero number as well. |
Thank you for explaining things to me.
I understand that user "0" (like root) in passwd is quite a silly thing to do. I have now edited the main crontab file. under /etc/crontab. It works exactly as I wanted with no problems. Thank you jdc2048. |
Quote:
-I'm trying to find a command to open a webpage virtually. To trigger the cgi program. (No GUI) No luck so far in finding a command which will work. ----------------------- You need to investigate: curl Good luck!! |
All times are GMT -5. The time now is 07:44 AM. |