Cron with php

Hi all

i know how to create and run cron job from inside the cpanel.

But how do you create and run cron job from php script without login into cpanel ??

Is it possibe that i create a cron job first by loggin in cpanel and set a php script to run at certain interval. Then afterwards i change the contents of the script so that it will again run as cron job ??

thanks
vineet

When you set a cron job in cpanel, it is just referencing a script file.
If you go and change the contents of that file to make the script do something else, then when the cron runs, it will do whatever you told the script to do. So yes you can edit the job script after it has been set without making any changes to the cron setup.

Hi sam

thanks for the reply.

what do you suggest for updating php file ??

fopen and fwrite functions ??

vineet

I just ftp a new version to the server and overwrite, just like any other file.

thanks sam

In cPanel go to the fileManager navigate to the file, select it and from the context menu edit it.

You can use any external cron, which starts processes on the URL.
example easycron

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.