• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Question Change scheduled task owner

macadia

Basic Pleskian
Server operating system version
AlmaLinux 9.6
Plesk version and microupdate number
18.0.73 #3
Hi! I need to move the scheduled tasks from one subscription to another... Would it be possible to do that simply by manually changing the sysUserId field in the psa.ScheduledTasks table?

In other words:
  • Old site: psa.sys_users.id = 4
  • New site: psa.sys_users.id = 1
If I update that value manually, will it change the owner of the scheduled task accordingly? The execution path would be the same, just under the new domain’s directory.

Thanks!
 
Hello @macadia
I do not recommend any manual interference in psa database.
Yes, there is no way to migrate scheduled tasks between subscriptions using Plesk UI, so it is better to recreate them one by one for new subscription. For me it is prefferable way.
However, since scheduled tasks in Plesk for Linux are used cron functionality you can try to copy them via shell
cp -p /var/spool/cron/old_subscription_system_user /var/spool/cron/new_subscription_system_user
Username can be obtained in UI
1762419480044.png
 
Hi, @alapshin thanks for your answer but I have another question.

I'm a very basic Plesk user, and especially a Linux and console user...

If I run that `cp` command you suggested, will it copy all the scheduled tasks to the new website? I ask because there are about 18 tasks to move, which is why I'm not replicating them manually one by one.

Thanks again.
 
> If I run that `cp` command you suggested, will it copy all the scheduled tasks to the new website
Yes, it will copy cronjobs to user of new subscription.
They should be available in both Plesk > Domains > new_subscription_name.tld > Scheduled tasks and Plesk > Domains > old_subscription_name.tld > Scheduled tasks after that.

Once you made sure that all of them are working as they should for new subscription, you can remove all 18 of them in Plesk UI Plesk > Domains > old_subscription_name.tld > Scheduled tasks
 
Hi, thanks for your reply.

I ran the command and the scheduled tasks were copied, but they weren't copied in the same format they were created in, and the comments weren't copied either, so the solution isn't perfect.

Anyway, thanks a lot for your help!
 
Back
Top