Plesk

Unable to activate scheduled task in Plesk: after refresh it is still shown as disabled

Symptoms

Unable to activate a scheduled Task in Domains > Scheduled Tasks - after refresh it is still shown as disabled

Cause

This is expected behavior when the main domain of the subscription is suspended - when it is suspended the following command is run automatically to stop the execution of crontab commands of a specific user account:

# plesk sbin crontabmng deny USERNAME

This command adds the value ##!PSA!## into the crontab user file preventing a scheduled task from execution so the files starts to look like the following:

# grep PSA /var/spool/cron/USERNAME
##!PSA!## 0 2 * * * (((((/opt/plesk/php/7.4/bin/php -f 'example.com/bin/console' -- 'cache:clear') ) ) ) ) > /dev/null

Resolution

Use one of the following solutions:

Solution 1 - Reactivate the subscription

  1. Log into Plesk

  2. Go to Subscriptions or Domains > Select subscriptions to change > click on Change Status:

  3. Go to Subscriptions or Domains > example.com and click on Activate or Suspend in the Hosting menu on right side bar.

Solution 2 - Activate the cronjob for the subscription

  1. Connect to the server via SSH/RDP.

  2. Run the following command to activate the cronjobs of that subscription (even if the subscription should remain suspended):

    # plesk sbin crontabmng allow USERNAME