• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 143
  • Last Modified:

scheduling an "at job" from a web page

Hi,
I need to schedule an "at job" from a webpage.
The www user is added in the file at.allow

The following two lines in my perl script are supposed to do the trick

$mycmd = "at -f /home/scripts/jobs/uptime_rpt -t ".@store[2].@store[1].@store[4].@store[5];
system($mycmd);

I have printed out $mycmd and it looks okay to me.

When I checked the apache error log, I found a message

job 1049142180.a at Mon March 31 14.47.00 2003
i dont know what is wrong with this? Infact the values and everything matches what is entered by the web user.

However I am sure the job is not scheduled because when i use ps to list the processes I do not find the uptime_rpt script running.  

Please let me know whats wrong if you know..Thanks a lot:)



0
manad
Asked:
manad
1 Solution
 
EarleAkeCommented:
It may have run and have errored off.  Might check the email for the username www.  Does the username www have a shell associated with it?  If not, the at job can not run.  Try to "su - www" then see if you can run the job manually and see what happens.
0
 
jptillmanCommented:
Try doing this instead of the system() call:

my $response = `$mycmd`;
print "<pre>" . $response . "</pre>";

This ought to show you what the "at" call responded with.
0
 
manadAuthor Commented:
hey thanks:) thast exactly what happened. the script was running but errored out. so now i have fixed the script and everything works well!
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now