Hello,
I’ve got to put together a script which is executed on a weekly basis (CRON) but I was wondering whether it’s possible to only execute it from CRON rather than from the browser.
Any ideas?
Cheers,
Jon
Hello,
I’ve got to put together a script which is executed on a weekly basis (CRON) but I was wondering whether it’s possible to only execute it from CRON rather than from the browser.
Any ideas?
Cheers,
Jon
AFAIK, nothing to worry about the path. Wherever you put the file but outside of the document root (htdocs) and give that path in the cron setting in plesk.
move your file out from public_html
Or that.
If you put the script file outside the document root, then it will never be possible to execute from browser.
Sure.
<?php
define('IS_CRON_INVOKED', true);
include 'script.php';
?>
<?php
if(false === defined('IS_CRON_INKOVED')){
exit;
}
//rest of script.php
?>
Sounds like a good plan, any idea what file path I would use in Plesk for the command?
Cheers,
Jon
i don’t know how to do it in plesk. i have been using cpanel since years