[ Video Sharing CMS v4 ] PHPVibe 3.3 Crons import issue

Started by repute,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

reputeTopic starter

What about the crons to download new youtibe videos from search/channels you want on an hourly basis.
Is it in already, cant find it.

Thanks for helping me out :D
  •  

Marius P.

Quote from: repute on
What about the crons to download new youtibe videos from search/channels you want on an hourly basis.
Is it in already, cant find it.

Thanks for helping me out :D

http://phprevolution.com/youtube-video-importer/ Maybe this video will give you an idea :)
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

reputeTopic starter

I see the automate button and clicking on it show the message a crons is added but I dont see it back on the scheduled task page in the admin.

PS I did upgrade from rc1 with the upgrade script.
  •  

Marius P.

Quote from: repute on
I see the automate button and clicking on it show the message a crons is added but I dont see it back on the scheduled task page in the admin.

Do you have any errors occurring?
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

hunt07777

I have a cron setup.. but it still has yet to pull the new video..
The YT user is HisVision777 and the new video is.. http://www.youtube.com/watch?v=Z133D2ow7hQ (test),
and the cron is...
http://screencast.com/t/vCY1fpkAgo,
but it says, it "never"... ran.. yet is set to 100 seconds. ???
  •  

Marius P.

3 questions :

1. Did you open the site meanwhile?
2. Do you have "exec" active on server?
3. Does it run when you visit domain.com/cron.php in browser?
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

hunt07777

I do have a command... on the server.
http://screencast.com/t/ieOL2x9bGkAR set to every minute...
but it appears that the cron only runs..
When I go to http://www.tgn10.com/cron.php manually.

It did work once.. but I think, that's only because you went to that address manually.

I have cron set to every 100 secs (vibe admin - SCHEDULED TASKS). http://screencast.com/t/y0XKREnCGbp
I have cron set to user id # 1 in (Owner of cron imports - CONFIGURATION) http://screencast.com/t/BmyuyK6IWYAN

And I have uploaded... http://www.youtube.com/watch?v=OyoWhBMkOho&feature=youtu.be  as a new test video to my channel.

I think all the bases are covered? No?

Thanks bud.
  •  

Marius P.

Yes, but cron setup looks like it has no time (in the image).

PHPVibe has a native cron trigger in the root index.php, so it should fire on user access to if the timing is right.
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

hunt07777

Well, it eventually did post last night...
But I am not sure if you did it or if it did it itself...
Hostmonster, said that ****** means that it will run every minute.
I changed it to 5 minutes.

So it did show on the site, but it took a few hours.

Just to verify..
http://screencast.com/t/EBmkf01riD
Run Interval is in "seconds" right?
It's saying the last time it ran was last night? http://screencast.com/t/EBmkf01riD
It's now 10/10 and 12:00:00, so that was almost 20 hours ago.

???
  •  

Marius P.

In vibe_config.php is this field:

/** Timezone (set your own) **/
date_default_timezone_set('Europe/Bucharest');

Info: http://php.net/manual/en/function.date-default-timezone-set.php
You should change it to your own so you can track normal time for you.
Yes, it's in seconds the run interval.
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

hunt07777

Awesome...
I made the change.
http://www.php.net/manual/en/timezones.php (according to this).

Very good.. So I manually ran the cron by visiting www.tgn10.com/cron.php..
and got http://screencast.com/t/2Wr14mvVzcRo

So now.. I am going to test it now.. to see when it runs again from this point.

Thanks.
  •  

Marius P.

Ok, but running the cron every minute from cpanel...you basically ping for nothing...

At least if you trigger it from cpanel, remove this from index.php (root) :
/* Crons trigger */
if(function_exists('exec')) {
$time_passed = time() - get_option('cron_lastrun');
$cron_interval = get_option('cron_interval');

if( $time_passed  > $cron_interval) {
$arrOutput = '';
update_option('cron_lastrun', time());
$command = "/usr/bin/php5 -f ".ABSPATH."/cron.php";
exec( "$command > /dev/null &", $arrOutput );
}
}
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

hunt07777

K. I removed the line of code from the index page..
Going to test the interval.
  •  

hunt07777

Ok, waited 20mins.. no change.
I added.. http://www.youtube.com/watch?v=UvyuA4Rf8FU&feature=youtu.be to the youtube channel..
However it has not show on the website.

??
Hmm??
  •  

Marius P.

https://gdata.youtube.com/feeds/api/users/userId/uploads?v=2&alt=json



change userId with your user and see if Youtube already returns that video.


What is the time in the cron in the admin? You need the be careful to that to, as it will not trigger if the time has not passed even if you go to /cron.php
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  


hunt07777

K. It still didn't work. It did however work when I went to the page in a browser.

Is there some sort of command that I am supposed to write in the cron job?

Hmm.
  •  

Marius P.

No command. It was meant to be triggered via a internal exec...but I guess you could use a webcron as well
I'll run some test with cpanel crons on some fresh install and let you know what I could digg.
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

hunt07777

Oh.. so you are saying that it always worked internally.. and that setting up a cron job through my cpanel, wasn't what I was supposed to do?

I had no clue.

Hmm.. well let me put the code back then...
And if it was.. then it wasn't running according to interval time on the script. ???

I am going to put the code back in the index.php

Cause I would rather have it run 1x a day, then not have it run at all.
  •  

Marius P.

It works for me on all setups...you can see on videosqq, "the bad guy" is the cron...
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

hunt07777

Then I must be doing something wrong.. hmm. Mario can I send you access via email, that way I can solve this mystery and help others not to miss the same thing, by posting the solution here?
  •  

Marius P.

I just need your admin panel access for starters to check the cron config.
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

hunt07777

Yes, I readded the cron code to the index page...
And in 1 day.. no update.
So I have emailed you my platform user/pass combo...
Hopefully we can figure out together, what I am missing, so that others can learn from my mistake.
Thank you so much Mario for your due diligence in this matter.
You are greatly appreciated!!!

Also.. if it works.. the latest video that should show up on the site.. is..
http://www.youtube.com/watch?v=NGE0GMZhm6Y

Thanks so much.
  •  

Marius P.

I can check it tomorrow, it's 22:12 on a sunday night here and I'm on my way into the old center.
But tomorrow I'll get back to you with an answer.
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

hunt07777

You got it bud. Thanks again. Talk to you soon.
  •  

hunt07777

You fixed it, didn't you? I can tell.
So what in the "heck" did I do wrong Mario? What was I missing?
I hope it wasn't anything obvious.
  •  

Marius P.

 :o I'm either growing old and my memory fails, but I recall I didn't get to you yet as I had a pretty heavy list for today.
However, I think you should test with a channel of more videos, as 1 may be skipped due to paginations, I wanted to check that today...
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

hunt07777

Yah.. I thought it was working. But now after looking today.. it has run.
I changed the intervals to 3600 seconds. But that didn't do anything.

Quote from: @Mario on
:o I'm either growing old and my memory fails, but I recall I didn't get to you yet as I had a pretty heavy list for today.
However, I think you should test with a channel of more videos, as 1 may be skipped due to paginations, I wanted to check that today...

I think alot of the channels have alot of videos.. we have added many more channels, with many more videos..

So still not sure. Problem still open and unsolved.

Thanks Mario.
  •  

hunt07777

Mario, have not heard back from you on this.
  •  

Marius P.

I'm still looking around for the issue, it seems it only happens to you.
If anybody else has this problem, please reply.
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

hunt07777

Ok, guys...
Unfortunately.. I could not get the "cron trigger" in the index to work for me and my server configuration at Hostmonster (my server company)... however I did find a solution... along with Mario's and the Hosting staff at Hostmonster.

Prerequisites:
1. Choose the owner to import to (CONFIGURATION). http://screencast.com/t/BIq20duIcJO
2. VIDEO IMPORTERS/YOUTUBE AUOTMATED/ IMPORT BY USER *TAB*
    a. Autopush selection must be off, otherwise you will miss your opportunity to Automate the import http://screencast.com/t/ZbfNgRGL 
    b. http://screencast.com/t/1Uhyi9KyWnU  Click "autopush" I kept missing this part too.
3. SCHEDULED TASKS  http://screencast.com/t/ogbzjzL6lcR rename and edit. If you run your cron from the server cpanel, like I ended up doing.. then the interval time won't matter because you will set the interval in the cpanel.

Ok.. the trigger in the index file did not work for me, but doesn't mean that it won't for you..
however you may want to verify your command line 153, before you decide whether it works on your server or not.

Keep in mind. going to /cron.php in my browser did work.
However my issue was always with triggering that file to execute..
and the trigger file resides in the index.php file, and I am not definite on this, but in order to trigger that line of code, you must visit the home page or refresh the site. Mario will correct me if I am wrong...

Let's continue..

1. root/index.php line 153
I had to verify the cron command path.
They told me to try...
$command = "/usr/php/53/usr/bin/php -f ".ABSPATH."/cron.php"; and...
  $command = "/usr/php/53/usr/bin/php -f /home4/spiriua1/public_html/tgn10/cron.php";
But neither one of them would trigger for me at Hostmonster...

The server staff... directed me to..
https://my.hostmonster.com/cgi/help/168 (A list of proper cron job commands..)
and helped me verify my paths.. to php on my server.

So then instead of having the index.php file trigger the cron..
I used...
http://screencast.com/t/PY70spRR
And this works perfectly....

In addition to this..
I see in SCHEDULED TASKS in my backoffice...
The LAST RUN COLUMN TIMES do update..  http://screencast.com/t/ogbzjzL6lcR

To doulble verify.. you could alwasy.. have an email update sent to your email and it will email you the execution results..

SO PROBLEM SOLVED!!

I am now commenting out the trigger code in my index file.

DONE AND DONE!!!!

Thank you Mario for all your help and diligence, I know you are super busy!!!
Thanks again bud, we appreciate you!!!
  •  

Marius P.

You forgot one important detail:

At first your cron.php had no execute permissions, thus the cpanel cron system could not fire it.


And this is very important, all of you better check your chmod of the file, if it has no execute permission, then it will not fire.
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

videonavy

Thanks for the insights here. I changed the run interval to 43200 but it only runs once a day. I will implement CPANEL crons option and see how it will work.
  •  

Marius P.

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

Similar topics (7)