Jump to content

Auto Database Backup with "CRON" module


Recommended Posts

Not really a module, but ... th title says all :P

 

The CRON module is free and already available in PrestaShop

 

Final Solution for PS 1.6 (not yet tested with 1.7) :

 

Put this file : cron_database_backup.php

 

-> in your admin folder, and then in your "CRON" module config, put one link like this :

 

h t t p :/ / w w w . your_site . com / your_admin_folder / cron_database_backup.php?secure_key=your_key

 

Tip : to find your key look at the other cron tasks ;)

 

Thanks to @NemoPS in this subject, to have putting me on the right way :wub:

Edited by Captain FLAM (see edit history)
  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites
  • 4 months later...

Probably because of the time limit of php scripts ...

Sometimes, you can change your php.ini, but main hosters don't permit even to customize it.

so you can try to add at the beginning " cron_database_backup.php " just after the <? php , this :

ini_set( 'max_execution_time', '600' );

it will change the max execution to 10 minutes (10 * 60 sec)

Let me know if it works ;)

Edited by Captain FLAM (see edit history)

Share this post


Link to post
Share on other sites
  • 2 months later...
  • 1 month later...

Hi,

Thank you for this solution, I was looking for something like this.

But please tell me how to find the secure key, I don't have any other cron jobs set yet.

Thanks!

Edited by razvy (see edit history)

Share this post


Link to post
Share on other sites
  • 5 weeks later...
On 2018/3/5 at 1:34 AM, razvy said:

Hi,

Thank you for this solution, I was looking for something like this.

But please tell me how to find the secure key, I don't have any other cron jobs set yet.

Thanks!

The secure key = md5(_COOKIE_KEY_+Your Shop name).

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 2 months later...

Hi.

I have put "cron_database_backup.php" file in the administration folder and I have configurated cron task.

In the task list it is with last execution yesterday, perfect, but where backups are saved?

I have searched in folder administration/backups, but there isn't nothing.

I have PrestaShop 1.6.1.20

Regards.

Share this post


Link to post
Share on other sites
23 hours ago, nuevoenesto said:

Hi

The Backup file is in the administrator folder / Backup

Kind Regards

Enrique

 

Hi, Enrique.

Have you read my post?

Althought Cron task is like executed, when I go to folder administration/backups, there isn't backup files. Only when I execute manual backup in Advanced Parameters backup file is saved in that folder.

Regards.

Share this post


Link to post
Share on other sites
  • 3 months later...
On 3/4/2018 at 6:34 PM, razvy said:

Hi,

Thank you for this solution, I was looking for something like this.

But please tell me how to find the secure key, I don't have any other cron jobs set yet.

Thanks!

Hi,

you can display the expected key with this:

Open the script, after "$secureKey = md5(....." add in a new line this:

print "$secureKey";

Save and open the site: w w w . your_site . com / your_admin_folder / cron_database_backup.php?secure_key=FALSE

The key will printed and nothing other will do. Copy the key and dont forget to remove the inserted line again.

 

Christian

 

Share this post


Link to post
Share on other sites
  • 1 year later...
Le 09/01/2018 à 11:23 AM, Captain FLAM a dit :

I have not tried (because I don't use the 1.7 version), but ... it maybe works as it uses the "classes/PrestaShopBackup.php" file provided by Presta team

You have to try it by yourself  ;)

Let see if some coder use the 1.7 version and can help you ;)

Share this post


Link to post
Share on other sites

Hi, we have bought the module that performs database and file backups. The cron commands as explained in the guide didn't work our until we changed it to "get" command instead.

But now the cron manages to perform each nigh the database backup (which is still quite small in size) but no file backup is performed . We are hosted at 1and1 and if we launch manually the backup it works (or I should say it displays an error but a file is generated paymydoctor) but the automatic task doesn't give anything. Some clue ?

The module bought is the Presta-Changeo module.

Edited by Brooke79
word missing (see edit history)

Share this post


Link to post
Share on other sites
Il y a 20 heures, Brooke79 a dit :

Hi, we have bought the module that performs database and file backups. The cron commands as explained in the guide didn't work our until we changed it to "get" command instead.
... ...
The module bought is the Presta-Changeo module.

You have to post in the Presta-Changeo module, NOT THERE !

or email to the dev ...

Thanks.

Share this post


Link to post
Share on other sites
  • 6 months later...

I would also look into AWS Backup that was recently released a couple of months ago. You can define when to backup, how long to keep them and can backup other services as well.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More