Current location: Hot Scripts Forums » Programming Languages » PHP » executing shell commands


executing shell commands

Reply
  #1 (permalink)  
Old 12-28-03, 10:55 AM
aparna aparna is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
executing shell commands

hi everyone,
i am creating a fe for cron.everything works fine except that for the system() command.( the most important part of my code)
<snip>
system("crontab /tmp/crontab.tmp/");
</snip>
any help on why its refusing 2 execute would be greatly appreciated.
Thanks in Advance,
aparna
Reply With Quote
  #2 (permalink)  
Old 12-28-03, 10:45 PM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Hi there,

What kind of error are you getting?

I thought crontab command doesn't output anything upon success (I may be wrong). In that case, you may not see anything even if it was successful, because system() returns the last line of system output. Try cron -l to see what jobs you have in crontab.

Also, there may be some issues with permissions - something to do with /etc/cron.deny or /etc/cron.allow file, but I'm not too sure of that.

By the way, by importing cron.tmp, I guess you are replacing the existing cron jobs with whatever you have in the file - did you make sure to include all the default/existing jobs, etc, set by your admin or control panel or whatever it may be?

Sorry I can't be a help really, but my 33 cents there.
__________________
Blavv =|
Reply With Quote
  #3 (permalink)  
Old 12-29-03, 06:12 AM
aparna aparna is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
hi,
thanks for the prompt reply.

what i meant by error was that the background process is not executing ie whatever is added from my php script is not getting added onto my crontab(when i checked ot cmd line using crontab l)

thanks again.
aparna
Reply With Quote
  #4 (permalink)  
Old 01-07-04, 03:48 AM
aparna aparna is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Thnak U All

hi,
thanks alot everyone
got it right at last (had 2 do with permissions)
Apu
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 07:45 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.