• 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 Synchronization of Cronjobs Between CLI and Plesk Panel

enerspace

Basic Pleskian
Server operating system version
Almalinux 8
Plesk version and microupdate number
Plesk Obsidian 18.0.70 Update #2
Is there a way to update the list of cron jobs via the CLI console? I have already executed several commands.

For example, when I enter: plesk sbin crontabmng get root I see the following list:

Code:
MAILTO=""
*/10    *       *       *       *       /opt/enerspace/daily-scripts/fix_errors/start.sh

However, in the Plesk Panel itself, I still see the old entry — see screenshot. The command: plesk sbin crontabmng refresh root unfortunately did not help.

1751649858881.png
Thanks!
 
There is currently no way to manage the cron jobs via a cli. Plesk writes the cronjob tasks at /var/spool/cron/* and then caches them at the psa.ScheduledTaskstable, which is used to display the cached versions of the actual cronjob files.
 
Why has my original reply disappeared?

Furthermore, I’m surprised by the information I received. Apparently, there is a way to make changes using plesk bin scheduler.

Why was I given contradictory information about this?
 
@enerspace , when was you reply posted, please? There was a scheduled maintenance on the Forum performed on the 7th of July and it might have been affected during the process

As for the contradictory information, I might have been wrong, if so, I would like to apologize if I misled you.
 
@enerspace your original question was to update the list of crontabs, not add a new one, 2 completely different questions imho and the way it was worded implies you're trying to get a normal crontab job (meaning you've used crontab -e to edit or adding a file in one of the /etc/cron.* path) to show up in plesk scheduler. In which case Sebahat is correct that those kind of jobs will not show up inside plesk since there's no database entry to show such job is created.

But yes you can use the code plesk bin scheduler to create cron jobs through CLI which will create the needed database entry so it will show up but you would be manually recreating the job so it shows up, otherwise you will have duplicate entries trigging at the same time, one will be invisible from plesk and the other will be known to plesk.
 
Thank you both for your responses.

@Sebahat.hadzhi: Thanks for the clarification regarding the forum maintenance – that probably explains why my original post disappeared.

@scsa20: I understand your point, but to be honest – I came to the forum specifically looking for a way to update cron jobs via CLI so that the changes are reflected in the Plesk UI. Knowing that this is only possible by recreating the job using plesk bin scheduler is exactly the kind of information I was hoping to get.

Sure, technically it’s not the same as editing a system crontab directly, and I get that. But would it really have been too much to mention this as a practical alternative, rather than just saying “there’s no way to do it via CLI”?

At the end of the day, I was looking for a solution that updates what’s visible in the Plesk interface – and it turns out plesk bin scheduler can do that. It would have been helpful to hear that upfront.
 
Back
Top