Forum Moderators: bakedjake
Not sure I posted right.
Anyway,please,I need your help:I have to set up a cronjob on my server.I have a .cgi script to execute on a regular basis.My server has a front-end panel where to choose comfortably the timing avoiding to enter specific Unix synthax, but requires however to enter the command row:
What could it be?
I tried the path to the script in various ways, such as
/usr/local/script.cgi
but nothing happens
The output sent me via mail said "No such file/directory"...
What can I do?
This is driving me crazy!
Please,help me, I never had to do with such an issue before now...
Thanks in advance
Sincerely
What they probably want you to do is to fetch a particular page (that will invoke the CGI script) from your website.
You will need to install a command-line HTTP-access tool in order to do this. For example, "wget".
I just came across this myself. The Drupal CMS requires that a CGI script be accessed periodically via a cron job.
There's a good explanation of this at the Drupal site:
[drupal.org...]
BTW, the default .htaccess file for Drupal permits access to the "cron" URL only from the local host, to prevent abuse.
requires however to enter the command row:
What could it be?
I tried the path to the script in various ways, such as
/usr/local/script.cgi
Unless your script is actually located in the /usr/local directory, that would have to be incorrect. I think by command row you mean full path or virtual path to the script from the machine root.
Put this in a plain text file with a .cgi or .pl extension (whatever runs on your server,) chmod it to 755, and run it from a browser:
#!/usr/bin/perl
## The previous line may need to be changed to wherever perl lives
print "content-type:text/html\n\n";
foreach $v (sort keys %ENV) {
print "$v : $ENV{$v} <br>\n";
}
## End of script
Among the environment variables will be one named DOCUMENT_ROOT. This is the machine's path to your domain, for example,
/virtuals/www/example.com
so if the script is in cgi or cgi-bin,
/virtuals/www/example.com/cgi-bin/yourscript.cgi
would be the "command line" for your cron or crontab job.
After collecting your environment variables, delete this script from your server, you don't want it where someone can stumble on it.