The simplest way to do that is:
Define what cron will do, what it will handle, whether in the database or in server files.
Create/test scripts with routines and functions that do the manipulations that were initially defined. Example: Create routines that read the available XML and update the values in the database.
CRON:
To create a scheduled task, do the following:
Click on the "Cron Jobs" icon inside cPanel, in Advanced.
Verify that the current email address is valid. Otherwise, enter a new email and click on "Update Email".
Select the configuration you want.
Alternatively, you can adjust the time settings individually. Minute, hour, day, month and day of the week can be modified to achieve your goal.
In the entry box to the right of "Command, type the name" of the file type, then add a space and provide the path to the file you want the command to be executed. (Link to your script)
Click on the "Add New Cron Job" button.
You just create a cron job to run a file on a given date and time with the desired repeat.
Scheduled tasks are easy to edit and delete.
Click on the "Cron Jobs" button inside cPanel.
Scroll down to the last section called "Cron Current Jobs".
Find the correct cron job and click "Edit" or "Delete" within the actions.
Editing does not have good automated tools, so it can be easier to copy command, cron work delete and recreate.
Creation in command lines. Examples only! sections in bold should be changed.
PHP
Command to run a cron PHP 5.5 job:
/opt/php55/bin/php/home/USUARIO/public_html/arquivo.php
Command to run a cron PHP 5.4 job:
/opt/php54/bin/php/home/USUARIO/public_html/arquivo.php
Command to run a cron PHP 5.3 job:
/opt/php53/bin/php/home/USUARIO/public_html/arquivo.php
Optional flag sometimes required for a cron PHP job:
php -q /home/USUARIO/public_html/arquivo. php
Command to use a specific php.ini file:
php -c /home/USUARIO/public_html/php.ini /home/USUARIO/public_html/arquivo.php
Command to get a remote file:
/usr/bin/GET http://www.seudomini....br/arquivo.php
Command to run a cron CGI job:
/home/perl/USUARIO/public_html/cgi-bin/arquivo.pl
SSH Extras
Command to run a cron shell script job:
/bin/sh/home/USUARIO/public_html/arquivo.sh
Command to import a database:
mysql -u mysql_user -p senha database_name < backup.sql
Command to export a database:
mysqldump -u mysql_user -p senha database_name > backup.sql
Sources:
http://forum.hostgator.com.br/topic/241-criar-e-excluir-um-trabalho-cron/
http://www.unixgeeks.org/security/newbie/unix/cron-1.html
What is the server operating system? You have shell/SSH access to it?
– bfavaretto
is linux, the access I have is Cpanel that has cron jobs. what I was able to do is access a specific url, which if logged in, it works right, but I couldn’t get it logged in by itself
– Leandro Marzullo