Forums / All Other Contributions/Addons / SnapShot [support thread]

SnapShot [support thread]

Views: 18,809

Results 1 to 20 of 33
22 Jan 2009, 5:47 PM
#1
skipwater avatar

skipwater

Totally Zenned

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

SnapShot [support thread]

SnapShot does exactly that. It takes a snapshot of your Zen Cart file system and
creates a file containing your Zen Cart directory names, file names, timestamp,
and permissions information. This is then used as a base line when you run
SnapShot again at a later date.

SnapShot will not stop hack attempts it is a tool that will allow you to scan and
find any differences in you Zen Cart file system after the fact. This is of course that you
created the base reference file before a hack.

SnapShot checks in the following order

  • New Files
  • Deleted Files
  • Size Differences
  • Timestamp changes
  • Permissions changes

There are some screen shots available in the download.

If you have any questions or require help this is where you should ask.

This mod can be found in the Downloads section under Admin Tools:
http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_41&products_id=1207

• 446F63746F722057686F •

22 Feb 2009, 11:13 PM
#2
erwin208 avatar

erwin208

New Zenner

Join Date:
Nov 2005
Posts:
44
Plugin Contributions:
0

Re: SnapShot [support thread]

Usefull contribution. Works well and fast. Used in 1.3.7 and 1.3.8 shops

26 Apr 2009, 3:10 AM
#3
gramkow avatar

gramkow

New Zenner

Join Date:
Sep 2008
Posts:
2
Plugin Contributions:
0

Re: SnapShot [support thread]

SnapShot

Get these errors after install and before first scan. Can't seem to solve it. Nice concept though. If anyone has any ideas, I'd appreciate it.

Warning: opendir(SNAPSHOT_ROOT_DIRECTORY) [function.opendir]: failed to open dir: No such file or directory in /home3/taborinc/public_html/store/store/admin/includes/functions/snapshot_functions.php on line 83

Warning: readdir(): supplied argument is not a valid Directory resource in /home3/taborinc/public_html/store/store/admin/includes/functions/snapshot_functions.php on line 85
Reference File Creation Failed.

26 Apr 2009, 4:12 AM
#4
skipwater avatar

skipwater

Totally Zenned

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

Re: SnapShot [support thread]

That error is most likely from the fact that item 2 of the install was not done:
2. In your admin directory open install-sql-snapshot-v1.php in your browser this will up date your database.
(After running you no longer need this file you may delete it.)

And then followed item 3:
3. In Admin->Configuration->SnapShot Are the settings that are needed and used with SnapShot. Just follow the instructions with each option. There are default settings pre-set that might work for you.

Skip

• 446F63746F722057686F •

18 May 2010, 8:19 AM
#5
andreitero avatar

andreitero

Zen Follower

Join Date:
Dec 2009
Posts:
207
Plugin Contributions:
0

Re: SnapShot [support thread]

Hello!
There must be something wrong with my database as i'm getting this error message when attemping to run the install script from admin in my browser:
1146 Table 'lemycouk_zc1.configuration_group' doesn't exist
in:
[SELECT configuration_group_id FROM configuration_group WHERE configuration_group_title = 'SnapShot';]

Any idea why would that happen?
Thanks!

18 May 2010, 1:34 PM
#6
skipwater avatar

skipwater

Totally Zenned

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

Re: SnapShot [support thread]

There must be something wrong with my database as i'm getting this error message when attempting to run the install script from admin in my browser:

Are you logged into ZC admin when you run install-sql-snapshot-v1.php ?

The steps to run install-sql-snapshot-v1.php are:

  1. Log into your admin.
  2. Once logged in change index.php??? to install-sql-snapshot-v1.php
  3. When completed use the browsers back button.

Skip

• 446F63746F722057686F •

18 May 2010, 6:00 PM
#7
andreitero avatar

andreitero

Zen Follower

Join Date:
Dec 2009
Posts:
207
Plugin Contributions:
0

Re: SnapShot [support thread]

skipwater:

Are you logged into ZC admin when you run install-sql-snapshot-v1.php ?

The steps to run install-sql-snapshot-v1.php are:

  1. Log into your admin.
  2. Once logged in change index.php??? to install-sql-snapshot-v1.php
  3. When completed use the browsers back button.

Skip

Yes i am logged into admin and i am doing exactly as per instructions. Replace the index.php with install-sql-snapshot-v1.php

19 May 2010, 12:35 AM
#8
skipwater avatar

skipwater

Totally Zenned

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

Re: SnapShot [support thread]

andreitero:

Yes i am logged into admin and i am doing exactly as per instructions. Replace the index.php with install-sql-snapshot-v1.php

I have attached a new install-sql-snapshot-v1.2.php zip file this should solve your issue.

Skip

• 446F63746F722057686F •

4 Jan 2012, 9:13 PM
#10
mdegrandis avatar

mdegrandis

New Zenner

Join Date:
Jun 2008
Location:
Oregon
Posts:
60
Plugin Contributions:
0

Re: SnapShot [support thread]

I am having serious troubles getting this to run...
Zc 1.3.9h
PHP Version 5.3.6
Database Patch Level: 1.3.9d

Double checked the instructions, and all files uploaded. No errors any where (cache, error_log)....

I put some code in snapshot.php and these indicate that the failure is on line 151

$fw->checkFiles();

Any ideas? I checked folder and file perms and they do the same behavior as either 777 or 755. ( I have suexec, so I tried 755).
Tried file perms as 777 and 644.
I get a 500 server error...and the page doesn't load the footer. or anything below the above line, including the checkFiles call.

Any ideas?

NiceBadge.com Lifetime guarantee on all badges! Free mock ups, 24 hour turn around time!

5 Jan 2012, 1:11 AM
#11
skipwater avatar

skipwater

Totally Zenned

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

Re: SnapShot [support thread]

After you ftp the files up to your site and then went to your zen cart admin.
You selected Tools->SnapShot
This will run SnapShot for the first time it will do the following:

Checks that you have downloaded and installed the class file your_admin/includes/classes/twzFileWatch.class.php

Creates a folder called your_admin/backups/snapshot
Adds two files snapshot_filewatch.txt, snapshot_cron.php to the folder.

  1. Is the class file twzFileWatch.class.php located in your your_admin/includes/classes/ folder?

This tells me that the class file is not found.

$fw->checkFiles(); 
  1. Did SnapShot create your_admin/backups/snapshot folder and did it place the two files it the folder?

If SnapShot did not create the new folder then chmod the backups folder to 777.

And run SnapShot again.

Skip

• 446F63746F722057686F •

5 Jan 2012, 4:36 PM
#12
mdegrandis avatar

mdegrandis

New Zenner

Join Date:
Jun 2008
Location:
Oregon
Posts:
60
Plugin Contributions:
0

Re: SnapShot [support thread]

Snapshot did make the snapshot directory.
I do have the class in that folder, and there are no inclusion errors.
If I do a```php
echo '<pre>';
print_r($fw);
echo '</pre>';

I can see the object, but since it is obfuscated ( I think that is the right term...) it isn't much help.
When I go to Tools->SnapShot I get the blank page I described.

I think 777 permisions won't work in my server environment, as I have suexec...

Thank you for your reply and if you have any further suggestions, I'd love to hear it. I will also post back if I find anything.

NiceBadge.com Lifetime guarantee on all badges! Free mock ups, 24 hour turn around time!

5 Jan 2012, 5:17 PM
#13
mdegrandis avatar

mdegrandis

New Zenner

Join Date:
Jun 2008
Location:
Oregon
Posts:
60
Plugin Contributions:
0

Re: SnapShot [support thread]

Ok, got it working...sorta. I could get it to run if I set

 $RecurseLevel = 0

I then changed the

$CheckFolder = array(DIR_FS_CATALOG . 'includes/', DIR_FS_ADMIN);

and then did this:

$fw->excludeFiles( array('./images/', './bmz_cache/') );

and increased the $RecurseLevel and it worked.

You were right, on the permissions for the snapshot_filewatch.txt file being world writable. Directories in my case are 755... (I might re-test this as I never modified the script to enforce 755 instead of 777...)

I think having about 100,000 images chokes the script/server....

NiceBadge.com Lifetime guarantee on all badges! Free mock ups, 24 hour turn around time!

5 Jan 2012, 5:55 PM
#14
skipwater avatar

skipwater

Totally Zenned

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

Re: SnapShot [support thread]

Glad to see that you fixed it.

I would interested to know how long it took to scan 100,000 files.

Skip

• 446F63746F722057686F •

5 Jan 2012, 6:05 PM
#15
mdegrandis avatar

mdegrandis

New Zenner

Join Date:
Jun 2008
Location:
Oregon
Posts:
60
Plugin Contributions:
0

Re: SnapShot [support thread]

skipwater:

Glad to see that you fixed it.

I would interested to know how long it took to scan 100,000 files.

Skip
If I could get it to run I would too!
But it crashed out after 30 seconds or so. Maybe the array is too big?

NiceBadge.com Lifetime guarantee on all badges! Free mock ups, 24 hour turn around time!

5 Jan 2012, 8:48 PM
#16
skipwater avatar

skipwater

Totally Zenned

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

Re: SnapShot [support thread]

Are you getting any debug error files in the zc cache folder?

I have used the below commands to increase php settings. If you don't have access to php.ini

I place these two lines of code in the htaccess file in the root of zc.

php_value max_execution_time 200
php_value memory_limit 256M

(Dose not work on all servers )

Skip

• 446F63746F722057686F •

5 Jan 2012, 8:52 PM
#17
mdegrandis avatar

mdegrandis

New Zenner

Join Date:
Jun 2008
Location:
Oregon
Posts:
60
Plugin Contributions:
0

Re: SnapShot [support thread]

Skip,
I won't have time to test this in the foreseeable future. Currently just inspecting the admin/* and includes/* and it'll probably stay that way until after I get 1.5 installed. I really appreciate your help, thank you so much.

NiceBadge.com Lifetime guarantee on all badges! Free mock ups, 24 hour turn around time!

5 Jan 2012, 10:05 PM
#18
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: SnapShot [support thread]

I have this mod on one site where it is working perfectly. Installed it on another site this morning, and when I attempt to run it I get this error:

SnapShot a System File Watch

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 716 bytes) in /home/my_user_name/public_html/my_admin_folder/includes/classes/twzFileWatch.class.php on line 15

Any ideas?

The best way to learn is to try stuff. But, back it up first.

5 Jan 2012, 10:36 PM
#19
skipwater avatar

skipwater

Totally Zenned

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

Re: SnapShot [support thread]

RescoCCC:

I have this mod on one site where it is working perfectly. Installed it on another site this morning, and when I attempt to run it I get this error:

SnapShot a System File Watch

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 716 bytes) in /home/my_user_name/public_html/my_admin_folder/includes/classes/twzFileWatch.class.php on line 15

Any ideas?

That error is caused by php running out of memory you need to increase the memory available to php.

I just posted this above but here it is again:
I have used the below commands to increase php settings. If you don't have access to php.ini

I place these two lines of code in the htaccess file in the root of zc.

php_value max_execution_time 200
php_value memory_limit 256M

(Dose not work on all servers )

Sometimes with the more memory php needs, more time is also needed so execution time is raised.

If it still errors try 512M

Skip

• 446F63746F722057686F •

5 Jan 2012, 10:45 PM
#20
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: SnapShot [support thread]

Doesn't work with my host, produces an internal server error.

The php memory limit is the same on this site as it is on the site where the mod is working. Both are 128MB.

Now, here's a kicker. For giggles I just uninstalled the current version of the mod and installed the previous version - the one with the buttons. It works.

The best way to learn is to try stuff. But, back it up first.