Support

Akeeba Backup for Joomla!

#9100 Cron issues when adding profile ID

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
n/a
PHP version
n/a
Akeeba Backup version
n/a

Latest post by nicholas on Tuesday, 11 October 2011 16:37 CDT

user46626
Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? Yes
Have I searched the forum before posting? Yes
Have I read the documentation before posting (which pages?)? Oh yeah
Joomla! version: 1.5.23
PHP version: 5.2.14
MySQL version: 5.0.91
Host: XLSHosting.nl VPS
Akeeba Backup version: 3.3.4

EXTREMELY IMPORTANT: Please attach your Akeeba Backup log file in order for us to help you with any backup or restoration issue.
- No logs created

Description of my issue:
When setting up a cron (native) in DirectAdmin for the automated backups with this command, all goes well.
/usr/local/bin/php -q -f path >/dev/null 2>&1

With this command, and only difference -profile=1, nothing hapens at all, no logs, no mention in backup files in backend, no email etc.
/usr/local/bin/php -q -f path -profile=4 >/dev/null 2>&1

I fixed this for myself by going to the backup.php file and editing this on line 261 and 326, hardcoding the profile id:
// Initialize the options
$profile = getOption('profile', 4);

// Load the profile
AEPlatform::load_configuration(4);

Any ideas for a permanent fix?

dlb
OK, first things first, I can't even spell "php".

You have a lot of alphabet soup on your command line that Nicholas doesn't have in his examples. Specifically, "-profile=4" is an argument to backup.php, not an argument to your php command. Maybe -f "path -profile=4"?

Try it without the -q, -f and whatever that 2>&1 is at the end. I think you're confusing it. :-D


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

nicholas
Akeeba Staff
Manager
Hi David-Andrew,

First, you seem to be using the PHP CGI instead of the PHP CLI interface. If unsure, run /path/to/php -v and look at the output. It should read something like:
PHP 5.3.4 (cli) (built: Dec 15 2010 12:15:07)
Not the "(cli)" part. If it reads cgi, FastCGI or fcgi it's not the binary you want.

If you do use the PHP CGI binary, the -q and -f options are not required. In this case the command line can be written as
/path/to/php /path/to/backup.php -profile=4 >/dev/null 2>&1


This is how I've set up this and other sites' automated backups ;)

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

dlb
Nicholas,

I figured out everything on his command line except "2>&1". Whet does that do?


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

nicholas
Akeeba Staff
Manager
It's "unixese" :) Linux, like all UNIX derivatives, defines two output streams: standard output (1) and error (2). The single greater-than sign redirects the default stream, the standard output. Thus, > /dev/null means that the standard output is redirected to the UNIX equivalent of a black hole. This leaves us with a problem. The error stream is still output and, in the case of CRON, will trigger an email with the error message. Therefore, in order to avoid that, you need to redirect the error stream to the bit bucket (/dev/null). The redirection operator can take an optional argument, telling it which output stream to redirect, just by prefixing it with the output stream's number. As a result, we have two choices:
1. Write 2>/dev/null which means "redirect output stream 2 (error) to /dev/null; or
2. Write 2>&1 which means "redirect output stream 2 (error) to output stream 1 (standard output)". Since the standard output is already redirected to /dev/null, the second stream goes to the first stream which goes to /dev/null.

Now, if you were a UNIX geek, which of the two would you use? The first one is too obvious and non-geeks can understand it. Therefore the standard practise is to use the second form which is very obscure, uses less characters and gives you that awe-inspiring geekiness points. Little wonder why it's stuck with us and everyone's using it, despite not realizing why exactly it works :D

PS: It took me a few years to realize what on Earth this line-noise-looking four character combo is supposed to really do. I only found out by accident, while searching for a completely different thing.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

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!