I never used nano to edit the crontab, don't know if that's working.
I always use crontab -e and never had issues (except stupid mistakes )
Moderator: leecollings
I never used nano to edit the crontab, don't know if that's working.
Ah sometimes its good to hear its not only me. I never knew there were different crontab possibilitiesEgregius wrote:I get different contents with nano /etc/crontab and with crontab -e
Code: Select all
<?php
$items=array('Bijkeuken','Garageportaal');
foreach ($items as $item)
if ($d['$item']['s']=='On'
&& past('$item')>60) {
sw('$item', 'Off');
lg('_cron60test');
}
?>
Code: Select all
[Wed May 08 13:19:01.596234 2019] [:error] [pid 676] [client 127.0.0.1:33746] PHP Notice: Undefined index: item in /var/www/html/secure/_cron60.php on line 4
Code: Select all
<?php
$items=array('Bijkeuken','Garageportaal');
foreach ($items as $item)
if ($d['$item']['s']=='On'
&& past('$item')>60) {
sw('$item', 'Off');
lg('_cron60test');
}
?>
Code: Select all
<?php
$items=array('Bijkeuken','Garageportaal');
foreach ($items as $item)
if ($d[$item]['s']=='On'
&& past($item)>60) {
sw($item, 'Off');
lg('_cron60test');
}
?>
Code: Select all
<?php
if ($d['Bijkeuken']['s]=='On'&&$d['PIRbijkeuken']['s']=='Off'&&past('PIRbijkeuken')>60) {
sw('bijkeuken', 'Off');
}
if ($d['Garageportaal']['s]=='On'&&$d['PIRgarageportaal']['s']=='Off'&&past('PIRgarageportaal')>60) {
sw('Garageportaal', 'Off');
}
?>
you are right, that what I am looking for.Egregius wrote: ↑Wednesday 08 May 2019 14:19 But, keep in mind that this will switch off always after 60 seconds.
You should do something like this, I wouldn't use a array for that:With this the light will only switch off 60 seconds after the last movement.Code: Select all
<?php if ($d['Bijkeuken']['s]=='On'&&$d['PIRbijkeuken']['s']=='Off'&&past('PIRbijkeuken')>60) { sw('bijkeuken', 'Off'); } if ($d['Garageportaal']['s]=='On'&&$d['PIRgarageportaal']['s']=='Off'&&past('PIRgarageportaal')>60) { sw('Garageportaal', 'Off'); } ?>
Everything can be done
Egregius wrote:Trigun[/quote wrote: Working on the skills
Sent from my iPhone using Tapatalk
Users browsing this forum: No registered users and 1 guest