Support

Akeeba Backup for Joomla!

#39402 cronjob script not working anymore

Posted in ‘Akeeba Backup for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
4.3.4
PHP version
8,0
Akeeba Backup version
9.6.2

Latest post by hannesausmwald on Tuesday, 29 August 2023 06:24 CDT

hannesausmwald

EXTREMELY IMPORTANT: Please attach a ZIP file containing your Akeeba Backup log file in order for us to help you with any backup or restoration issue. If the file is over 10MiB, please upload it on your server and post a link to it.

Hi, I have a script which is running as a cronjob to backup my site automatically. The script still working on another hoster company (hosteurope.com), but not on my joomla installations on all-inkl. com

This is the script

#<?php

exec("/usr/bin/php /www/htdocs/w012c22d/venture-royale-club.de/cli/joomla.php akeeba:backup:take 2>&1", $out, $result);
echo "Returncode: " .$result ."<br>";
echo "Ausgabe des Scripts: " ."<br>";
echo "<pre>"; print_r($out);

?>

and this is the error code I get

Returncode: 255
Ausgabe des Scripts:

Array
(
    [0] => ParseError {#466
    [1] =>   #message: "syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)"
    [2] =>   #code: 0
    [3] =>   #file: "./plugins/system/admintools/src/Feature/DoNoCreateNewAdmins.php"
    [4] =>   #line: 24
    [5] =>   trace: {
    [6] =>     ./plugins/system/admintools/src/Feature/DoNoCreateNewAdmins.php:24 {
    [7] =>       Composer\Autoload\includeFile($file)
    [8] =>       › /** @var array Groups that are forbidden to have their details modified */
    [9] =>       › protected array $groups_backend = [];
    [10] =>       ›
    [11] =>     }
    [12] =>     ./libraries/vendor/composer/ClassLoader.php:344 { …}
    [13] =>     ./libraries/src/Autoload/ClassLoader.php:59 { …}
    [14] =>     Joomla\CMS\Autoload\ClassLoader->loadClass() {}
    [15] =>     spl_autoload_call() {}
    [16] =>     ./plugins/system/admintools/src/Extension/AdminTools.php:597 { …}
    [17] =>     ./plugins/system/admintools/src/Extension/AdminTools.php:590 { …}
    [18] =>     ./plugins/system/admintools/src/Extension/AdminTools.php:168 { …}
    [19] =>     ./plugins/system/admintools/services/provider.php:44 { …}
    [20] =>     ./libraries/vendor/joomla/di/src/ContainerResource.php:182 { …}
    [21] =>     ./libraries/vendor/joomla/di/src/Container.php:96 { …}
    [22] =>     ./libraries/src/Extension/ExtensionManagerTrait.php:177 { …}
    [23] =>     ./libraries/src/Extension/ExtensionManagerTrait.php:99 { …}
    [24] =>     ./libraries/src/Plugin/PluginHelper.php:232 { …}
    [25] =>     ./libraries/src/Plugin/PluginHelper.php:192 { …}
    [26] =>     ./libraries/src/Application/ConsoleApplication.php:256 { …}
    [27] =>     ./cli/joomla.php:76 { …}
    [28] =>   }
    [29] => }
)

https://www.venture-royale-club.de/Akeeba Backup Debug Log.txt

 

Thank you for your help

System Task
system
The ticket information has been edited by Steffen Hanne (hannesausmwald).

tampe125
Akeeba Staff

Hello,

I'm sorry, but why are you using such script? If you want to trigger a backup on the same server where your site is installed, simply use the CLI script. If you want to trigger backups for another site that is not on the server running the CRON, use the Frontend Backups feature.

That script relies on using the exec() function that is blocked by most hosts, moreover you are hardcoding the path in the script, so it will fail if it's moved to another location.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

hannesausmwald

Hello Davide,

 

thank you for your fast reply. The hoster all-inkl.com only allows to set a cronjob to a file via http or https like domainname/script.php. I could set the path to the cli/joomla.php file, but how could I set the parameters?

https://www.venture-royale-club.de/"cli/joomla.php akeeba:backup:take" is not working

 

Greetings

Steffen

tampe125
Akeeba Staff

I think you're mixing some commands, please take a look at this page of the docs: https://www.akeeba.com/documentation/akeeba-backup-joomla/automating-your-backup.html#frontend-backup 

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

hannesausmwald

Hi Davide,

 

I tried to set up a frontend backup. It started, but failed in the end. That´s why I would prefer to use the cli method via the script. Php exec is allowed by the hoster. I worked flawlessly in the past .

 

Thank you

Steffen

tampe125
Akeeba Staff

Sorry, I was typing a wrong reply. The error is triggered in the function that blocks you to create new admins.

This is something completely unrelated to taking a backup, since we do not perform any kind of operations on the users, we're just taking a backup. You can try to disable Admin Tools, but, once again, this smells very weird, because a WEB protection is triggered in a CLI environment.

The fact that it was working before is not a given: maybe the host changed something in their server configuration or you add a new extension or you modified the some configuration values.

Honestly this setup seems very error prone, it's way easier to trigger it using Frontend Backups. If that's not possible from your server, you can use an external service like WebCron.org or simply configure a PC (even a raspberry pi) to take backups at specific time.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

hannesausmwald

Hi Davide,

 

Problem solved. It seems that the hoster all-inkl.com has integrated older and newer php cli versions on the server. When you use /usr/bin/php it uses an outdated php version. But you can directly call a newer php-version in the script with /usr/bin/php80 which will work.

https://all-inkl.com/wichtig/anleitungen/skripte/sonstiges/per-skript/shellskripte-ausfuehren_304.html

 

Thanks for helping

 

Steffen

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!