• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Scheduled tasks that made via bash script showed incorrectly in the UI

YarDStaff

New Pleskian
I made a bash script that will create cron jobs in the crontab file.

A bit details: bash script creates type of cron "Run a PHP script" which means that we have script path and arguments if required. Also it is necessary to select the php version in the UI.

The issues I noticed:

1) script arguments that were made by my script are always quoted. Not big deal, but looks confusing, especially if we compare with crons that were made under the UI.

2) the php version is correct in the crontab, but incorrect in the UI. After some tests I can confirm that script runs correctly, but if we click on "save" under the UI - it will break everything(because incorrect version is selected in the UI). Screenshots are attached.
 

Attachments

  • image_2024-05-21_16-59-32.png
    image_2024-05-21_16-59-32.png
    3.1 KB · Views: 9
  • photo_2024-05-21_16-59-49 (2).jpg
    photo_2024-05-21_16-59-49 (2).jpg
    9.1 KB · Views: 7
  • photo_2024-05-21_16-59-59.jpg
    photo_2024-05-21_16-59-59.jpg
    17.7 KB · Views: 9
What are the commands you're using in your Bash script to create these cronjobs?
 
I can't tell from your code whats exactly gets added to the contab. Which makes it hard to help you. Can post an single crontab command example so that could try to replicate your issue?

Also, a scheduler utility has been added to the Plesk CLI in Plesk version .61, which might be useful for you. It currently hasn't been added to the documentation yet. Running plesk bin scheduler --help will list the options.
 
I can't tell from your code whats exactly gets added to the contab. Which makes it hard to help you. Can post an single crontab command example so that could try to replicate your issue?

Also, a scheduler utility has been added to the Plesk CLI in Plesk version .61, which might be useful for you. It currently hasn't been added to the documentation yet. Running plesk bin scheduler --help will list the options.
Unfortunately we have .60 version, so this command is not valid for me yet.

Here is the simple code snippet for you to run on your environment.

Bash:
#!/bin/bash
temp_cron_file=$(mktemp)
cron_job="15 3 * * * /opt/plesk/php/7.1/bin/php -f 'httpdocs/public/cron.php' -- 'test'"
crontab -l > "$temp_cron_file" 2>/dev/null
echo "$cron_job" >> "$temp_cron_file"
crontab "$temp_cron_file"
rm "$temp_cron_file"
 
The quoted argument is a mystery to me too. But I can't replicate the issue with the selected PHP version as you described. My guess would that it's caused because the PHP version is not installed or available to the service plan. But if you want to know for sure I recommend to contact Plesk support for an investigation of the issue.
 
The quoted argument is a mystery to me too. But I can't replicate the issue with the selected PHP version as you described. My guess would that it's caused because the PHP version is not installed or available to the service plan. But if you want to know for sure I recommend to contact Plesk support for an investigation of the issue.
I can confirm that the PHP version is exists. Screenshots are attached. Maybe the issue is because of we have a lot of them, but not only one. (Note: cron from screenshots is the one that was created under the UI, but not with bash script).

Great thanks, I appreciate your help. Will try to contact Plesk support.
 

Attachments

  • Screenshot from 2024-05-23 09-57-47.png
    Screenshot from 2024-05-23 09-57-47.png
    44.1 KB · Views: 1
  • Screenshot from 2024-05-23 09-58-06.png
    Screenshot from 2024-05-23 09-58-06.png
    3.6 KB · Views: 1
Back
Top