Page 1 of 1

WEBCAM plugin & CRONJOB

Posted: Wed Jul 11, 2018 10:27 am
by Lespius
Hi Everyone !

I am unable to make the plugin work properly, there is something I don't understand, or that I am doing wrong. So I need your help !!!!

1. Upload the files in my plugin directory --> done
2. Set up the plugin in my control panel --> done
3. Move the updateWebcam.php file into the load/crons folder --> done
4. Launch the Cronjob at the address /template/load/cron.php?password=***** --> done
I think it executes correctly, because I have an answer on the webpage. A image is saved, a thumbnail is created, as well as the table and everything.

But.... that's all ! No additional image is saved. Looks like the cronjob is running only manually and not on a regular basis. Images are saved only when I connect to /template/load/cron.php?password=*****

So I think something is missing, or wrong. I have tried to change the plugin settings, or to have a look in the file, but I don't have the knowledge.

Would be happy to have some assistance !
Thank you !!

Re: WEBCAM plugin & CRONJOB

Posted: Wed Jul 11, 2018 11:13 am
by proger
I made a folder where I store photos downloaded from webcam.
In here I have a script that rename every snap photo my webcam uploads to the folder
The name on the file has to be the same as in settings on the plugin

Here is the script you can use for renaming the photo


<?php
$fileList = glob('*.jpg');
var_dump($fileList);
foreach (glob("put in folder name here/*.jpg") as $filename) {
echo "Renaming " . $filename . " now.</br>";
if(file_exists($filename)) {
rename($filename, "name of your photo here" . ".jpg");
echo $filename . " is now name og photo" . ".jpg</br>";

Re: WEBCAM plugin & CRONJOB // SOLVED

Posted: Wed Jul 11, 2018 12:26 pm
by Lespius
Solved !!

I discovered that I needed to create a cron-job, and I did one on cron-job.org, thanks to viewtopic.php?f=60&t=1247&p=5843#p5843.

And now it works perfectly fine !

Thank you Proger for your answer, even if it was not my problem. But I must say that I had previously a problem with the FTP upload from my IPCam, because the name of the file has a timestamp. So your script could be interesting for that.

Re: WEBCAM plugin & CRONJOB

Posted: Thu Jul 12, 2018 9:04 pm
by Dehatter
how are you running the cron job?

Are you using a service?

I suggest https://cron-job.org as it is simple, free, and notifies you if it fails.

Tom

Re: WEBCAM plugin & CRONJOB

Posted: Sat Jul 14, 2018 7:08 pm
by Lespius
Absolutely. I have found this site in one of your post. Dramatically simple, all is working perfectly !!

Check http://www.meteo-cugy.ch/template/plugi ... /index.php

so coooool 8-)

Re: WEBCAM plugin & CRONJOB

Posted: Wed Jul 25, 2018 4:33 am
by Dehatter
Fantastic!! Some good clouds there yesterday too!

Tom