Is there a way to run the following script via PHP
http://www.magentoadvisor.com/magento-backup/tutorial-magento-backup-scripts-part-2/
I have tried to use exec, shell_exec, system but none of them are working. They do work when I try exec(‘whois domain.com’) though so it must be something I am doing wrong!!
If this is not possible does anyone know of a good way of backuping up Magento via PHP, unfortuantely I don’t have SSH access.
Thanks
UPDATE
This is the code I am trying to use
system('magento-backup-script.bin -date', $output);
var_dump($output);
Output: int(127)
Php safe mode is off
UPDATE:
I managed to get i working by copy the script into the PHP file and use the tactics operator to run the command. Thanks for all your help everyone
you can use system to execute commands on the system, for example:
If your string is called backup and is located in /home/rob/scripts/backup/megento you can issue the command like so:
if your getting the result 127, this is known as an exit code, int 127 usually means that the bas script attempted to execute a command but the command was not found.
looking at the bash script it uses the tar command to create the archive, have you made sure tar exists and is installed on the server.
you may also want to pipe the output to an error log to see what’s happening:
or if that is leading to an empty file maybe its a perms problem, try the following: