Auto Backup-Error on Page

Hello,
On both of our sites www.carolinaparent.com and www.charlotte parent.com, we have the auto backup plugin installed. We are getting an error on our pages and it is affecting the code on page, ex. Menu is gone. Here is the error we get:

Warning: scandir(): Directory name cannot be empty in D:\Inetpub\carolinaparent\cmsAdmin\plugins\autoBackup\autoBackup.php on line 63 Warning: Invalid argument supplied for foreach() in D:\Inetpub\carolinaparent\cmsAdmin\plugins\autoBackup\autoBackup.php on line 66

You can view his error as well by going to the domains above. We are talking to the web host but they are not much help. When I look at auto backups, it says there are none available and they were there earlier.

Thanks!
April

Re: [Jason] Auto Backup-Error on Page

Jason,

I figured out the error and it was happening because the web host changed the directory name of the auto backup. So, I had to deactivate the plugin to fix the issue. Here is what our web host told us:

[font "Tahoma"]Our server admin was able to determine that it was the carolinaparent and charlotteparent.

We have determined that the site carolinaparent and charlotteparent are responsible for high CPU usage on one of our shared servers. This site is using up to 100% of the available CPU and causing all sites on that server to resolve slowly or not at all. This also caused fastcgi errors and timeouts for other customers.

In order to protect the performance of the server, we have disabled the below directories by renaming them.

D:\Inetpub\carolinaparent\cmsAdmin\data\backups_disabled_by_newtek

D:\Inetpub\charlotteparent\cmsAdmin\data\backups_disabled_by_newtek

We found that these backup files were being written to and the filesystem was hitting them fairly hard causing the usage issues.

"D:\Inetpub\charlotteparent\cmsAdmin\data\backups\forum.charlotteparent.com-v2.04-daily-Thu.sql.php","14146"
"D:\Inetpub\charlotteparent\cmsAdmin\data\backups\forum.charlotteparent.com-v2.04-hourly-17.sql.php","8456"

This also shows why the issue was occurring at only a specific time each day. During the backups. There were over 14,146 file access hits on one file alone in 6 minutes. Both sites were hitting the same type of files exactly the same way. Please be aware that we do make daily backups of databases and website files that we can pull from if necessary.



My question is this:

What can we do to reactivate the auto backup plugin and not cause this issue again? The auto-backups have been extremely large and are using up a lot of our disk space as well.

Thanks!

April

Re: [apdance9] Auto Backup-Error on Page

By Jason - November 19, 2010

Hi April,

The first thing we need to do is change the name of the backup folder from
D:\Inetpub\carolinaparent\cmsAdmin\data\backups_disabled_by_newtek
back to
D:\Inetpub\carolinaparent\cmsAdmin\data\backups

The way they've renamed this means that you wouldn't be able to do a manual back up or restore. After you've renamed it, check to make sure the folder still has read/write permissions. Run a manual backup from General Settings to make sure it works.

Next, If you don't want/need to keep all the backups you currently have, you can just delete them. This won't affect anything else.

Finally, we can change some code inside the plugin to have it run less frequently. By default, the backup runs once an hour, once a day, once a week, and once a month.
If you open up autoBackup.php you'll see this line of code:
// create backup files
$units = array('hourly', 'daily', 'weekly', 'monthly');


This array is used to determine which backups need to be created. By removing elements from this array, we're removing types of backups that will be created.
For example, if we only want backups run weekly and monthly, we'd change the code to look like this:
// create backup files
$units = array('weekly', 'monthly');

Daily and hourly backups won't occur.

In order to reduce the number of backup files you keep, you can change some variables up at the top. You'll see code similar to this near the top of your file:
// UPDATE THESE VALUES
$GLOBALS['AUTOBACKUP_HOURS'] = 24; // Keep automatic backups for the last X hours (max 24)
$GLOBALS['AUTOBACKUP_DAYS'] = 3; // Keep automatic backups for the last X days (max 7)
$GLOBALS['AUTOBACKUP_WEEKS'] = 3; // Keep automatic backups for the last X weeks (max 52)
$GLOBALS['AUTOBACKUP_MONTHS'] = 3; // Keep automatic backups for the last X months (max 12)


These values determine how long we want to keep old backup files before deleting them. In this exaple, we keep hourly backups for 24 hours, daily backups for 3 days, weekly backups for
3 weeks and monthly backups for 3 months. To reduce the amount of time we keep these, just reduce these numbers.

After all of this is done, reactivate your plugin. Let us know if you run into any other issues concerning this.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Auto Backup-Error on Page

Jason,

Thanks so much...I will adjust these settings and this should help us. The other thing is that when I looked at the files that the system is creating...so of them are not correct in conjunction with our domain and wondering if these are correct or if this is causing a problem. It seems like we have so many backups that seem to be incorrect/do not apply (see screenshot for list of all backups the system has created within our site). Examples: digicity.org, dkqximjkfoofkjmixqkd.charlotteparent.com, drexel.edu, evergreensuk.com, etc. Is this correct?



Thanks!

April
Attachments:

backup-screenshot.jpg 1485K

Re: [apdance9] Auto Backup-Error on Page

By Jason - November 19, 2010

Hi April,

Some of those look like they've been created when people access a subdomain (ie http://info.charlotteparent.com/). A good way to avoid this is to set a prefrix in the plugin. If you go to autoBackup.php you'll see this line:
$GLOBALS['AUTOBACKUP_DEFAULT_PREFIX'] = ''; // Backup file prefix, leave blank to use current domain name

This variable allows you to set your own file prefix. If you don't set one, it will use the current domain being used. Try this:
$GLOBALS['AUTOBACKUP_DEFAULT_PREFIX'] = 'charlotteparent.com'; // Backup file prefix, leave blank to use current domain name

This will ensure they are all named the same and that they will be removed properly. What I would do is delete any backup files that look old or just not correct. Then you can see easily if the changes you are making are making a difference.

Give that a try and let me know if you run into any issues.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/