Forums / All Other Contributions/Addons / BackUp ZC [Support Thread]

BackUp ZC [Support Thread]

Views: 60,196

Results 241 to 260 of 286
10 Jan 2014, 2:33 PM
#241
pewe avatar

pewe

Zen Follower

Join Date:
Aug 2006
Posts:
134
Plugin Contributions:
0

BackUp ZC [Support Thread]

Thanks Skip.

I asked the question because I changed

$file_name = $_SERVER['HTTP_HOST'].'_'.date("mdY-Hi"); // Create File Name

to

$file_name = $_SERVER['HTTP_HOST'].'_'.date("dmY-Hi"); // Create File Name

but the file names still have a mdy format.

Have I missed something here??

10 Jan 2014, 4:30 PM
#242
pewe avatar

pewe

Zen Follower

Join Date:
Aug 2006
Posts:
134
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

pewe:

Thanks Skip.

I asked the question because I changed

$file_name = $SERVER['HTTP_HOST'].''.date("mdY-Hi"); // Create File Name

> to
> ```
$file_name = $_SERVER['HTTP_HOST'].'_'.date("dmY-Hi"); // Create File Name

but the file names still have a mdy format.

Have I missed something here??

It's OK - the date has changed, but only on the website file and I was looking at the .sql file.

I had to change the other two lines to alter the format of the sql file name.

I have one other question though.

I would like to change the 'time' so it does not use the time on the server but matches the time zone I am in. The server is using a US timezone but I am in the UK (London/Europe).

Is this possible? - if so, how?

Thanks

10 Jan 2014, 4:59 PM
#243
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: BackUp ZC [Support Thread]

Because the script is using the server time it would be to much to change the code.
Some hosts allow you to change the server time zone GMT +- #, you might want to check.

Skip

• 446F63746F722057686F •

10 Jan 2014, 5:05 PM
#244
pewe avatar

pewe

Zen Follower

Join Date:
Aug 2006
Posts:
134
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

skipwater:

Because the script is using the server time it would be to much to change the code.
Some hosts allow you to change the server time zone GMT +- #, you might want to check.

Skip

Thanks Skip.

What I found strange was that when I look at the backup files created using Filezilla or the Control Panel File Manager, the date of creation is shown in GMT, but the file name is generated using GMT +6 (ie time zone of the server).

However adding this

date_default_timezone_set('Europe/London');

like this

 // Grab a large chunk of memory
  // If your server allows this adjustment then adjust to meet your needs.
  // ***********************************************************************
  // ini_set("memory_limit","128M");
  // ini_set("memory_limit","192M");
  // ini_set("memory_limit","256M"); 
     ini_set("memory_limit","512M"); // default
  // ini_set("memory_limit","768M");
  // ini_set("memory_limit","1000M");
date_default_timezone_set('Europe/London');

appears to have done the trick.

10 Jan 2014, 5:33 PM
#245
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: BackUp ZC [Support Thread]

pewe:

It's OK - the date has changed, but only on the website file and I was looking at the .sql file.

I had to change the other two lines to alter the format of the sql file name.

I have one other question though.

I would like to change the 'time' so it does not use the time on the server but matches the time zone I am in. The server is using a US timezone but I am in the UK (London/Europe).

Is this possible? - if so, how?

Thanks

One way, before presenting the date formatting, I would create a date variable that is equal to the current date, then would shift the date timezone to the desired timezone, then would as coded display the date but have the date variable following in the presentation of the date add a comma, then the variable for the new date. The below hasn't been tested, but generally pieced together from php manual date/time related functions.

So could insert some of the below with the applicable statement:

$newDate = new time();
$newDate->setTimezone(new DateTimeZone('London/Europe'));
//Assuming London/Europe is the correct format.

$file_name = $_SERVER['HTTP_HOST'].'_'.date("dmY-Hi", $newDate); // Create File Name

There appears to be other ways to do it as well, such as using date offset like functions, but ideally you would have somewhere a variable set to represent your local timezone and that would be fed into the function above instead of hard coding it, unless the standard becomes all dates will be in GMT and then there is no question

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

10 Jan 2014, 5:47 PM
#246
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: BackUp ZC [Support Thread]

pewe:

Thanks Skip.

What I found strange was that when I look at the backup files created using Filezilla or the Control Panel File Manager, the date of creation is shown in GMT, but the file name is generated using GMT +6 (ie time zone of the server).

However adding this

date_default_timezone_set('Europe/London');

>  like this
> 
> ```
 // Grab a large chunk of memory
  // If your server allows this adjustment then adjust to meet your needs.
  // ***********************************************************************
  // ini_set("memory_limit","128M");
  // ini_set("memory_limit","192M");
  // ini_set("memory_limit","256M"); 
     ini_set("memory_limit","512M"); // default
  // ini_set("memory_limit","768M");
  // ini_set("memory_limit","1000M");
date_default_timezone_set('Europe/London');

appears to have done the trick.

Of course, something like that fix is the preferred method. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

10 Jan 2014, 5:51 PM
#247
pewe avatar

pewe

Zen Follower

Join Date:
Aug 2006
Posts:
134
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

Sorry - me again.

The file name is created using

$file_name = $_SERVER['HTTP_HOST'].'_'.date("d-m-Y_H:i");

This creates a file 'domain.com_10-01-2014_17:45.zip'

How could I change this so that the file includes the 'store name' in place of or as well as the domain name in front of the date/time.

Thanks

10 Jan 2014, 6:11 PM
#248
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: BackUp ZC [Support Thread]

pewe:

Sorry - me again.

The file name is created using

$file_name = $SERVER['HTTP_HOST'].''.date("d-m-Y_H:i");

> 
> This creates a file 'domain.com_10-01-2014_17:45.zip'
> 
> How could I change this so that the file includes the 'store name' in place of or as well as the domain name in front of the date/time.
> 
> Thanks

Wherever desired add in the constant STORE_NAME, though not sure what the correct variable name is if running a multi-store from a single database.

$file_name = $SERVER['HTTP_HOST'].''.STORE_NAME.'_'.date("d-m-Y_H:i");

For example, but would also be a good idea to do some string formatting on it to remove spaces, and do something with apostrophes and quotes, etc...  Not sure off top of my head, which function(s) would be best to use at this point, but I'm sure ZC has some built in to handle filenames.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

10 Jan 2014, 7:29 PM
#249
pewe avatar

pewe

Zen Follower

Join Date:
Aug 2006
Posts:
134
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

mc12345678:

Wherever desired add in the constant STORE_NAME, though not sure what the correct variable name is if running a multi-store from a single database.

$file_name = $SERVER['HTTP_HOST'].''.STORE_NAME.'_'.date("d-m-Y_H:i");

> For example, but would also be a good idea to do some string formatting on it to remove spaces, and do something with apostrophes and quotes, etc...  Not sure off top of my head, which function(s) would be best to use at this point, but I'm sure ZC has some built in to handle filenames.

Thanks - appreciated.
Your suggested code did the trick, including working with spaces. Will check out other things like apostrophes etc later.
11 Jan 2014, 3:50 AM
#250
pewe avatar

pewe

Zen Follower

Join Date:
Aug 2006
Posts:
134
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

Hi again.

I have now done some tests and find I have a issue.
When trying to extract a downloaded full web site backup there were problems with 'corrupt archive' messages.

I have now determined that the cause of the problem is that within the 'images' directory are subdirectories with periods in the name - for example '1.Tools' or '2.Accessories'.

So the period in the directory name seems to cause a problem.

HOWEVER:
This problem does not occur when I use the compression routine in my control panel to zip the same directories, nor does it appear with another backup script I have that also compresses the directories/files in ZC (this is not a ZC plugin but does a similar job).

Anyone any suggestions as to how I can rectify this issue.

Thanks

11 Jan 2014, 1:59 PM
#251
pewe avatar

pewe

Zen Follower

Join Date:
Aug 2006
Posts:
134
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

OK - this needs checking out on a server other than mine just in case the problem is just on my server which is running PHP 5.4.18 running on Apache 2.2.25.

To clarify my previous post:
On my server -

  • If I use the compress (zip) function in my control panel admin, my whole site backs up and extracts perfectly.
  • If I use this script the extraction fails IF any directory contains files or directories with a period (decimal point) in the name.

What was causing an issue were 2 things:

  • Images subdirectories whith numers followed by periods (eg '1.Tools')
  • A template which included fancybox which included a directory called 'fancybox-1.3.4'.

What is puzzling is why the zip function in the file manager in my control panel works (as does another backup script) with such file/directory names, but this script doesn't, as I would have thought they use the same zip utility on the server???

Perhaps someone could create a similar directory or install the template (from here) and backup their site then try extracting it as a further test.

Feedback would be appreciated.

7 Feb 2014, 3:17 PM
#252
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

pewe:

Hi again.

I have now done some tests and find I have a issue.
When trying to extract a downloaded full web site backup there were problems with 'corrupt archive' messages.

I have now determined that the cause of the problem is that within the 'images' directory are subdirectories with periods in the name - for example '1.Tools' or '2.Accessories'.

So the period in the directory name seems to cause a problem.

HOWEVER:
This problem does not occur when I use the compression routine in my control panel to zip the same directories, nor does it appear with another backup script I have that also compresses the directories/files in ZC (this is not a ZC plugin but does a similar job).

Anyone any suggestions as to how I can rectify this issue.

Thanks

Ditto here.
Website and database backups made from within cPanel & phpMyAdmin restore without any issues.
Neither Website or database backups made using this routine will restore.

Luckily these are backups made for our sandbox site between each addon and failure to restore is not as critical as it would be if needed to restore our live site.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

7 Feb 2014, 11:02 PM
#253
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: BackUp ZC [Support Thread]

RixStix:

Ditto here.
Website and database backups made from within cPanel & phpMyAdmin restore without any issues.
Neither Website or database backups made using this routine will restore.

Luckily these are backups made for our sandbox site between each addon and failure to restore is not as critical as it would be if needed to restore our live site.

pewe:

OK - this needs checking out on a server other than mine just in case the problem is just on my server which is running PHP 5.4.18 running on Apache 2.2.25.

To clarify my previous post:
On my server -

  • If I use the compress (zip) function in my control panel admin, my whole site backs up and extracts perfectly.
  • If I use this script the extraction fails IF any directory contains files or directories with a period (decimal point) in the name.

What was causing an issue were 2 things:

  • Images subdirectories whith numers followed by periods (eg '1.Tools')
  • A template which included fancybox which included a directory called 'fancybox-1.3.4'.

What is puzzling is why the zip function in the file manager in my control panel works (as does another backup script) with such file/directory names, but this script doesn't, as I would have thought they use the same zip utility on the server???

Perhaps someone could create a similar directory or install the template (from here) and backup their site then try extracting it as a further test.

Feedback would be appreciated.

Question:
Have you downloaded the zip file to your local system and then ran 7zip or something similar?
Or are you using cpanel unzip/restore on the web server?

Skip

• 446F63746F722057686F •

7 Feb 2014, 11:20 PM
#254
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

skipwater:

Question:
Have you downloaded the zip file to your local system and then ran 7zip or something similar?
Or are you using cpanel unzip/restore on the web server?

Skip

In my case, a cPanel website backup is downloaded to local. cPanel restore by selecting the downloaded file. no unzip necessary
In my case, a phpMyAdmin backup(Export/gzip) is downloaded to local. phpMyAdmin restore (Import) by selecting the downloaded file.

I did notice that a phpMyAdmin backup is in the 7MB range when gzip compression selected.
A BackupZencart file is in the 47MB range when gzip compression is selected. zip compression yields a 0MB file. tar compression yields a 0MB file.

Running winzip on the website backup yields the attached screenprint.
[Attachment no longer available]

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

8 Feb 2014, 12:16 AM
#255
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: BackUp ZC [Support Thread]

RixStix

Have you tried 7zip on the website backup file?

Skip

• 446F63746F722057686F •

8 Feb 2014, 12:56 AM
#256
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

skipwater:

Have you tried 7zip on the website backup file?
Installed 7zip. Website files extract with quite a few filesize errors without identifying specific files. Not overly concerned about website files.
BU Database only. files appear in 2 places according the screen after the BU is completed. Tried all compressions. Both locations 0MB files. That is not what I expected.

Really glad I found this out when needed to restore BU sandbox files instead of really needing to restore the live site.

Quitting time for now. Another look tomorrow.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

8 Feb 2014, 1:33 AM
#257
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: BackUp ZC [Support Thread]

Thanks for checking it with 7zip.

What it sounds like is that the script is over running the memory setting of php.

If you can control php settings in your .htaccess file try these settings.

php_value upload_max_filesize 30M
php_value post_max_size 30M
php_value max_execution_time 400
php_value mysql.connect_timeout 240
php_value memory_limit 1024M

Skip

• 446F63746F722057686F •

8 Feb 2014, 2:22 AM
#258
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

skipwater:

Thanks for checking it with 7zip.

What it sounds like is that the script is over running the memory setting of php.

If you can control php settings in your .htaccess file try these settings.

php_value upload_max_filesize 30M
php_value post_max_size 30M
php_value max_execution_time 400
php_value mysql.connect_timeout 240
php_value memory_limit 1024M

Skip

Will try tomorrow. Tnx

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

8 Feb 2014, 3:26 PM
#259
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

Server didn't like that.

What I did this morning:
removed all log files.
removed all email archives.
Database size decreased from 42MB to 36.6MB

Backup #1: DB: yes, filetype: gzip, Backup sql files only
2 files created: *.sql in the admin/backup folder 4.29mb *.tgz in cache folder 889KB

Backup #2: DB: yes, filetype: zip, Backup sql files only
2 files created: *.sql in the admin/backup folder 42.57mb *.zip in cache folder 0b

Backup #3: DB: yes, filetype: tar, backup sql files only
2 files created: *.sql in the admin/backup folder 0b *.tar in the cache folder 0b

PHP Version: 5.2.17 (Zend: 2.2.0) PHP Memory Limit: 128M PHP Safe Mode: Off
PHP File Uploads: On Max Size: 32M POST Max Size: 8M
Database Data Size: 36,570 kB Database Index Size: 6,914 kB

Zencart: v1.5.1 installed in sandbox.
DB upgraded from v1.3.9h
v1.5.1 plugin installed using NEW install option

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

17 Feb 2014, 10:28 PM
#260
missinglife avatar

missinglife

Zen Follower

Join Date:
Apr 2009
Location:
Portland, OR
Posts:
104
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

I am using backup zc Version: 1.0.7,
I got these error messages:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/1.0.1e-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_fcgid/2.3.6 Server at the4thmuse.com Port 80

can anyone help me out!!!!
Thanks
Arwen