• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

crontab

R

robinthecam

Guest
Hi there,

I´m a newbie on setting up cron jobs... My Problem is, i want to execute a .php script on a specified time! can someone tell me what is the syntax for my command!

Thanks in advance
r
 
1) find where your php interpreter resides

$ which php
/usr/local/bin/php

2) Add the following line to begin of you php script:

#!/usr/local/bin/php -q

3) make you php script executable

$chmod 755 /path/to/your/script.php

4) Make sure you script works properly by trying to start it from the command line

$ /path/to/your/script.php

<script output here>

5) add command line to your crontab

$ crontab -e

For example, to start script every day at 5:00:

0 5 * * * /path/to/your/script.php
 
duh ?

Hey guys,

Isn't this supposed to be the Windoze thread???

Or am i missing something?
 
Thanks defencer,

Can you tell me what this does:

Originally posted by defencer
#!/usr/local/bin/php -q

Also...

when i access this file from http it works fine, but from shell i get these errors.

/home/httpd/vhosts/site/httpdocs/ts/page.php: ?: No such file or directory
/home/httpd/vhosts/site/httpdocs/ts/page.php: line 3: syntax error near unexpected token `set_time_limit(0)'
/home/httpd/vhosts/site/httpdocs/ts/page.php: line 3: `set_time_limit(0);'

Thanks!
 
ahh i think it was because i added the code inside the <?


#!/usr/local/bin/php -q
<?
echo "hello";
?>

works!

i am getting this error in my actual file which works great through http, but not thorough shell.

Fatal error: Call to undefined function: iconv() in /home/httpd/vhosts/site/httpdocs/tb/file.php on line 237

$xml = iconv("ISO-8859-1", "UTF-8",$xml);
 
Are you running windows or linux? It makes a difference. This is a Windows forum and it looks like you are talking about Linux
 
<Gack> yeah the previous post seemed relevant. maybe a moderator can cut this thread to plesk 6.0?
 
Back
Top