PrestaShark Posted November 20, 2015 Share Posted November 20, 2015 Hi. I wonder how to launch automatic database backup with this link index.php?controller=AdminBackup&addbackup i want to put this link to Cron job and launch once a day but the &token=0db7fbef3208258e7956820f914dbf3f messed my conception. Any ideas? Link to comment Share on other sites More sharing options...
bellini13 Posted November 20, 2015 Share Posted November 20, 2015 well, your crontab would also have to log into the back office in some way too I would create my own php file with the following code <?php require(dirname(__FILE__).'/config/config.inc.php'); $admin_dir = '/full/path/to/your/admin/folder/'; define('_PS_ADMIN_DIR_', $admin_dir); $backup = new PrestaShopBackup(); $backup->add(); Put that file in your root folder and then use that in your crontab. Make sure the admin_dir variable is set correctly You could add a token to that as well to prevent it from accidentally being called from a bot, user etc... Link to comment Share on other sites More sharing options...
PrestaShark Posted November 20, 2015 Author Share Posted November 20, 2015 Wow. Thanks. I will test it So if my admin folder is admin12345 then $admin_dir = '/full/path/to/your/admin/folder/'; sould be $admin_dir = '/admin12345/'; ? Link to comment Share on other sites More sharing options...
bellini13 Posted November 21, 2015 Share Posted November 21, 2015 no, it would be the FULL Path, including the admin folder 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now