Page 2 of 2
Re: Help with Cron Job and ImportCumulusFile script
Posted: Tue 15 Apr 2014 5:19 pm
by water01
A direct link to your Cpanel page will not work the URL fails because we are not logged in.
Copy and paste the command line from the Cpanel page into the Forum posting window.
Re: Help with Cron Job and ImportCumulusFile script
Posted: Tue 15 Apr 2014 5:24 pm
by mm23
I have no command line from the Cpanel page. The command line I sent is from my Cumulus toolbox and works fine
Re: Help with Cron Job and ImportCumulusFile script
Posted: Tue 15 Apr 2014 7:41 pm
by mcrossley
But you said you had tried a few command line options that produced error messages?
Using a url in a PHP command line will not work, you have to use the command line format that is documented in the import file...
// COMMAND LINE
// It is also possible to run this script from a PHP command line, eg via a cron job in Linux, or a scheduled task in Windows.
// Example of a 'Windows' command line...
// php importcumulusfile.php file=realtime.txt table=Realtime type=realtime key=letmein retainVal=48 retainUnit=hour
Re: Help with Cron Job and ImportCumulusFile script
Posted: Tue 15 Apr 2014 7:56 pm
by mm23
I thought to execute command line every minute and I think it would be easiest with the cron job. So far Cumulus toolbox did It from my cumulus computer but it is possible to do only once per hour
Re: Help with Cron Job and ImportCumulusFile script
Posted: Wed 16 Apr 2014 9:04 pm
by mm23
Here is the answer on my question:
php -q /home/yourusername/public_html/yourdomain.com/....path to importcumulfile.php/importcumulusfile.php type=realtime key=youruniquekey table=realtime file=realtime.txt retainVal=2 retainUnit=day
...with or without retain unit and value. In my case retains mean that my table will retain only data for last two days
As I said you can use this command for Cpanel cron job to import data from your realtime.txt file into a realtime table