• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • 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.

Question cron with arguments

straddi

Basic Pleskian
Server operating system version
Debian 11
Plesk version and microupdate number
18.0.68 #1
Sorry,

I'm in the wrong forum.

Hi,

I would like to run the following command in Plesk via cron in a directory named httcdocs/test

php -d memory_limit=-1 bin/magento cron:run

I can't seem to get this to work. Can anyone help me figure this out?
Best regards
 
I tried this as follows.
Ruin a command
/opt/plesk/php/8.3/bin/php /var/www/vhosts/domain.com/httpdocs/test/bin/magento php -d memory_limit=-1 cron:run

However, this creates an exhausted allowed memory size of 134217728 bytes.

This should be prevented by:
php -d memory_limit=-1
which also works on the CLI level.
 
It is important what options and in which order do you use; as I understand, you don't need to mention php twice (`/opt/plesk/php/8.3/bin/php`, `php`), and `-d memory_limit=-1` should be right after the first `php`.

Here is an example.
Code:
# /opt/plesk/php/8.3/bin/php /var/www/vhosts/domain.com/httpdocs/test/bin/magento php -d memory_limit=-1 cron:run
128M

# /opt/plesk/php/8.3/bin/php -d memory_limit=-1 /var/www/vhosts/domain.com/httpdocs/test/bin/magento cron:run
-1
 
Back
Top