requincreative's avatar

Scheduled Task not Running as Expected

Greetings,

I am using the Adldap2-Laravel package and running the Import command nightly via a scheduled task. The Import command can be found here: https://adldap2.github.io/Adldap2-Laravel/#/auth/importing

Because of LDAP pagination and available system resources I have to split up my imports as the staff import has 6,500 users but the student import has almost 40,000. To do this I have tried running separate scheduled tasks and changing the Filter flag. The first import (Staff) is set at daily() and runs fine at midnight but the Student import which is scheduled for 1:00 AM using dailyAt() is not running at all.

Here are my tasks in the command kernel.php file

$schedule->command('adldap:import', [
            '--no-interaction',
            '--restore',
            '--delete',
            '--no-log',
            '--filter' => '(memberof:1.2.840.113556.1.4.1941:=cn=Staff,OU=Groups,DC=Example,DC=Com)',
        ])->daily();


$schedule->command('adldap:import', [
            '--no-interaction',
            '--restore',
            '--delete',
            '--no-log',
             '--filter' => '(memberof:1.2.840.113556.1.4.1941:=cn=Student,OU=Groups,DC=Example,DC=Com)',
        ])->dailyAt('01:00');

Is this because the task scheduler sees these as a duplicate tasks (commands)? If so, how do I get around that to automate them nightly?

0 likes
2 replies
CorvS's avatar

@requincreative Have you tried running the student task using daily() (without specifying the time)? Simply to check if it's maybe related to the task and not the scheduler.

Did you check if scheduling works in general? Especially for that time.

requincreative's avatar

Thanks. I have not tried it as a scheduled task using just daily() because I was afraid of system crash with multiple instances of the same task running at the same time.

I have run the student command manually with success and the Staff scheduled task runs fine every night at midnight so I am assuming that it is not the command and related to calling the same command multiple times in the scheduler.

Please or to participate in this conversation.