You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
HI NIck,
two things...
1: Can you think of any issues of setting up a daily cron task to automatically backup the database. It appears pretty straightforward by just creating a new daily cron file and duplicating some of the helperdbbackup.php code.
2: I can't back up my database using the db helper because the ecom_orderitems table is very large - 700mb+. Just times out, no error or anything. Do you know of any php settings I can adjust, or can I alter the helperdbbackup.php code so only the last 6 months data from ecom_orderitems is backed up??
Offline
1: Can you think of any issues of setting up a daily cron task to automatically backup the database. It appears pretty straightforward by just creating a new daily cron file and duplicating some of the helperdbbackup.php code.
No issues that I can think of, other than you will definitely want to set up a server-based cron job to run cron. By default cron is triggered when somebody access a page on the site at a specific time. When you're doing things that will create delays like connecting to Amazon or eBay or running your own custom database backup, you'll want to offload that to the server so users don't experience delays when cron is triggered. Plus offloading to the system guarantees it runs regularly. Here's how to do that:
(1) Set up a server-based cron job using your hosting control panel which runs every 5 minutes. The program to run will be as follows (change URL, change path to /utilities directory if needed):
/usr/bin/wget -O - -q https://yourdomain.com/utilities/runcron.php
(2) Using the management interface, access System / Component / Settings / Cron Settings and set 'Software Automated Cron Status' to false (0).
2: I can't back up my database using the db helper because the ecom_orderitems table is very large - 700mb+. Just times out, no error or anything. Do you know of any php settings I can adjust, or can I alter the helperdbbackup.php code so only the last 6 months data from ecom_orderitems is backed up??
The PHP ini variable max_execution_time is set to unlimited (off) in K9, so I don't understand why you're hitting a timeout. Perhaps in Apache. It's already skipping data on any tables that are too large to export.
Offline