Moodle: Scheduled tasks set for one minute sets itself to ASAP, but never reruns - moodle

I have been monitoring the Complete learning plans which are due task, which is set to run every minute. I have set the cron.php script with a password to force the cron job to run. When I reload the page I notice that the cron job runs, sets the next run date time, but doesn't run again and changes to ASAP.
I am using Moodle 3.6.3 on Windows IIS.

Create a task in task scheduler to execute the script after every minute (or any time you want). Use "Start a program" action. Replace "C:\Program Files\PHP\v7.2\php-win.exe" with your php version and also change the moodle path to yours.

Related

Scheduled Task Launch Failure - 2147944309

There is a scheduled task that executes a script. It was running fine until one day it started to fail with 'Task Scheduler failed to start "Task" task for user "domain account". Additional Data: Error Value: 2147944309.' It failed on a Friday, ran on a Saturday, then began failing daily after that. My research on this found that 2147944309 means the account is either disabled or locked out. I double checked the account and it was neither. Server is Windows 2012. It's an RDS server so it reboots every morning. After it reboots a warning message shows in history for the task "Task Scheduler did not launch task "Task" as it missed its schedule. Consider using the configuration option to start the task when available, if schedule is missed."
What I was able to determine:
account is not locked or disabled
account is in the administrator group on the server
permissions are correct on the script
set it to run with highest privileges
able to manually kick off the task
the task is in a folder under Task Scheduler Library
created a test task to run notepad under the same account in the folder. It did not run
created a test task in a test folder under Task Scheduler Library to run notepad under the same account. It did not run
created a test task directly Task Scheduler Library to run notepad under the same account. It ran
moved the task under directly under Task Scheduler Library.
The scheduled task kicked off for four days in a row and then began failing with the same error. Yesterday, I set the option to restart every minute three times if it fails. It didn't execute a second or third time after failing. Any ideas what the heck is going with this?

Listen for an event in powershell to run a function when a particular program is run?

Is it possible to subscribe to an event in powershell when a particular executable is run?
We have an application that hogs up memory and then causes the system to crash, and if I could attach an event that starts a timer when it starts running and just kills after a certain amount of time, that would fix the issue.
You can use task scheduler to trigger on an Windows Event.Task Scheduler Trigger
Then you can add your powershell script as an action. Even delay the task if you like
As Crusadin sugggests, have a script run when an eventlog entry is made. I have just done the same thing here in work.

moodle no change in status 'in progress'

I am facing problem with moodle configurations. I have 2 courses setup and the activity completion set for these courses are 1. manual self comletion and 2. Manual completion by manager.
I have also added required blocks for the same.
I completed the course successfully, marked completed by student as well as manager. In the status block it shows block image
Need help to get the status showing complete. I dont know what exactly i am missing.
You should start the Moodle cron tasks in order to update the completion status.
You can manually start the tasks either by running (only if you are an admin) a command from your browser:
http://your.site/admin/cron.php
or by running a command line in you system (from a terminal), like:
/path/to/your/moodle/installation/admin/cli/cron.php
A list of predefined cron tasks of you system can be found under:
http://your.site/admin/tool/task/scheduledtasks.php
or going under Site administration->Server->Scheduled tasks

Scheduled Job & Balloon tip

I am looking for a way to run a job on a schedule and also alert the user to that running job. Specifically, I am using PowerShell to manage a computer lab scenario, and between sessions I want to refresh the environment, clean off the desktop, reset shortcuts pinned to the task bar for the next session, etc. But I want to warn anyone sitting at the machine that this is about to happen. However, my scripts that use Balloontips very successfully as regular scripts don't work as scheduled jobs. They run, and I have verified they run as the user in question, by creating a Scheduled Job that rights a text file to the user desktop. But Balloon Tips don't actually appear. Is there some secret to getting this to work, or is this a form of "interaction" that a scheduled job just can't do?
I also tried an alternative approach, launching the browser with a web page warning of the impending cleanup. That also didn't work. Suggesting some limits to what can be done as a Scheduled Job.
I would much rather go the very "integrated with the OS" route of the balloon tips, but for the life of me it seems like that just isn't an option. So, any other suggestions for providing user info by way of a scheduled job?
Since this runs in Session 0 where GUI interaction doesn't exist you must resort to some other mechanism.
You say this happens between sessions. You could show your ballon via another "notification script" that is executed from within your ScheduledJob. You have options here. For example:
Add entry to registry Run key that will self delete on run. Shows popup when user logs in (session change ? ). Entry executes posh script which parameters you could craft, i.e. (powershell -File notify.ps1 -ArgumentList "Operation bla bla..")
Add ScheduledTask that doesn't run in Session 0 (regular task). You need to do that only once. Every next time you run this job to show notification to the user from within main script via schtasks run or ScheduledTasks module depending on your system.
Add a ScheduledTask that check periodically EventLog for the input of your main script. The task would start on logon and subscribe to event log notifications. I don't like this as the script must run non-stop.

TYPO3: Scheduler for directmail not working

I have installed TYPO3 extension "direct_mail", and Im trying to configure the scheduler to automatically invoke the mailer engine, but the task keeps getting delayed (shows the yellow button), and never actually works. What am I missing?
Cronjob:
*/15 * * * * /html/cronjobs/scheduler.sh
scheduler.sh:
#!/bin/bash
php_cli /home/www/pXXXXXX/html/typo3/typo3/cli_dispatch.phpsh scheduler
Scheduler:
Setup check:
I'm just guessing that you didn't configure the Scheduler. In general Scheduler is an extension, which allows you to run TYPO3 tasks easily, however you need to invoke the Scheduler from the system cron to make it working. Checklist:
in ADMIN TOOLS > Scheduler choose 'Setup check` from upper select
Make sure that second frame is green if you didn't create _cli_scheduler BE account do it now - it's required
In third box (CLI script) there is a command to run the scheduler from command line
/Absolute/path/to/your/typo3-instance/typo3/cli_dispatch.phpsh scheduler
copy it and run in the terminal, to check if it's working
If everything's ok add the line to your system cron and set some period (ie: every 5 minutes)
set new timings for your DM task and control after 5 minutes if last execution was done with the cron (in your screenshot currently it's 'Manual')