0

On my server, I have always used a quick one use cronjob to apply the magento patches, as I don't have access to SSH. It worked fine, however with this new patch that has come out (SUPEE-6482), it is requesting to revert patch SUPEE-6285 and apply the new one. I tried reverting via the cronjob by just running it again, and I get this:

Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

patching file app/Mage.php
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file app/Mage.php.rej
patching file app/code/community/Phoenix/Moneybookers/controllers/MoneybookersController.php
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file app/code/community/Phoenix/Moneybookers/controllers/MoneybookersController.php.rej
patching file app/code/core/Mage/Adminhtml/Controller/Action.php
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file app/code/core/Mage/Adminhtml/Controller/Action.php.rej
patching file app/code/core/Mage/Adminhtml/controllers/AjaxController.php
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.

And so on...

So my question, is if this is possible to be done this way, and if not, what other means would there be to revert the patch without using SSH?

-- NOTE --

I have already gotten one tip, stating:

You should be able to revert the patch also by calling it via cron, you just need to add a -R to the command so if your cron job command was:

30 3 * * * sh /var/www/webserver/patch.sh

then to revert use the cronjob command

30 3 * * * sh /var/www/webserver/patch.sh -R 

However, my control panel does not allow for that kind of customization, it simply asks for a time and the file, not leaving room to even add the '-R', so my thinking is that is it possible within the patch to have it run through the processes and when it asks 'Assume -R?' .. have it marked yes instead of no?

1

This is really really not what I would recommend but if you need to run a file, there are two ways:

Method 1: Create another .sh file to run your patch.sh file Let's name it revert.sh.

The content of that file could be:

#!/bin/sh
./var/www/webserver/patch.sh -R

Put your revert.sh into your crontab configuration.

Method 2: Create a PHP file to run your patch.sh file

Create a PHP file which you can run from the crontab (for example revert.php).

Content of this file:

shell_exec('/var/www/webserver/patch.sh -R');

Make sure that this file does not lie within your DocumentRoot and that it cannot be run from outside.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.