I am having issues properly setting up the following CRON job to automate backups on my client's website.
The site is Joomla-based and I am using Akeeba Backup to handle the backups. The recommendations for the command-line CRON jobs are as follows:
Use the following command in your host's CRON interface: /path/to/php /var/www/domain.com/cli/akeeba-backup.php
Remember to substitute /path/to/php with the real path to your host's PHP CLI (Command Line Interface) executable. Do remember that you must use the PHP CLI executable; the PHP CGI (Common Gateway Interface) executable will not work with our CRON scripts. If unsure what this means, please consult your host. They are the only people who can provide this information.
domain.com used as an example
I have CRON installed and running on Ubuntu 20.04.
The following code is in crontab -e
0 3 * * * /usr/bin/php7.4 /var/www/domain.com/cli/akeeba-backup.php --profile=1 --description="Full automated backup"
The site is running PHP 7.4 with FPM installed.
When I run which php
the following is returned: /usr/bin/php
When I run ls -l /usr/bin/php
the following is returned: lrwxrwxrwx 1 root root 21 Aug 31 18:09 /usr/bin/php -> /etc/alternatives/php
When I run ls -l /etc/alternatives/php
the following is returned: lrwxrwxrwx 1 root root 15 Aug 31 18:53 /etc/alternatives/php -> /usr/bin/php8.0
As this shows version 8.0 instead of 7.4, which the site is using, does this mean the CRON job should be using version 8 instead.
Sample log output from /var/log/syslog
Oct 1 11:39:01 domain CRON[38538]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Any help is greatly appreciated.