Koozali.org: home of the SME Server

Shadow Copy

Offline steever

  • *
  • 185
  • +0/-0
    • Open-Sesame
Shadow Copy
« on: February 04, 2008, 01:49:19 PM »
Hi.  I read with interest this fragment of the wiki:

Quote
Shadow Copy

Letting network users restore previous versions via Explorer has dramatically reduced the need for me to involve myself in restoring files and is a tremendous timesaver overall.

This is already implemented, it just needs verification it works.

I had a look at the associated bug tracker entry ...

Quote
http://bugs.contribs.org/show_bug.cgi?id=1549

but I am still not sure about the project's status, installation and use.

Could someone enlighten us all about the power of this contrib?  It sounds great.

Thanks
Saving the world ... one server at a time.

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Shadow Copy
« Reply #1 on: February 04, 2008, 09:40:23 PM »
steever

Based on that bug report and my reading of it, and some limited testing just now, Comment#9 has the details, with a rpm version requirement specified in Comment#7

To check the installed rpm version
rpm -qa e-smith-samba
On my sme7.3 sme this gives
e-smith-samba-1.14.1-3.el4.sme
so the required rpm is more recent than that specified (e-smith-samba-1.14.0-20)


Initially disable ShadowCopy for specific ibays or users you don't wish to take snapshots for
eg
db accounts setprop user1 ShadowCopy disabled
db accounts setprop user2 ShadowCopy disabled
db accounts setprop ibay1 ShadowCopy disabled
db accounts setprop ibay2 ShadowCopy disabled

Note: For the script to work correctly, leave two or more users enabled

Then enable and expand templates
config setprop smb ShadowCopy enabled
signal-event ibay-modify Primary

You need to schedule shadow copy to take snapshots.
You can do this manually from the command prompt
or run a cron job as often as required. 
Snapshots are only taken if there are changes.

/etc/e-smith/events/actions/shadow-copy-rotate
 
Note: You will need enough space free to take a copy of the entire /home/e-smith/files directory plus any
changes that take place.

A suitable cron job that runs the script every hour from 10am to 5pm on weekdays would contain

Create a file
/etc/cron.d/shadowcopysnapshot
which contains

# Shadow Copy snapshot Crond Entry
#+-----------------------Minute           (0-59)
#|    +-------------------Hour of Day    (0-23)
#|    |    +---------------Day of Month  (1-31)
#|    |    |    +-----------Month of Year (1-12)
#|    |    |    |    +-------Day of Week   (0=Sun,6=Sat)
#v   v   v   v   v
00    10,11,12,13,14,15,16,17   *    *   1,2,3,4,5    root  /etc/e-smith/events/actions/shadow-copy-rotate


After saving the above script do
/etc/init.d/crond restart

In Windows access the snapshot files via Windows Explorer properties page
A Windows client exists in WinXP SP2
To obtain a client for Windows 2000SP3+ download from here
http://technet.microsoft.com/en-gb/windowsserver/bb405951.aspx

Feedback to the bug tracker at
http://bugs.contribs.org/show_bug.cgi?id=1549
...

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Shadow Copy
« Reply #2 on: February 04, 2008, 10:37:56 PM »
steever & all

I have added this:
http://wiki.contribs.org/ShadowCopy
 
Please try it & test the functionality.
Report contrib problems to the bug tracker, and howto problems here.
...

Offline steever

  • *
  • 185
  • +0/-0
    • Open-Sesame
Re: Shadow Copy
« Reply #3 on: February 04, 2008, 11:59:35 PM »
Wow!  Thanks Ray.  ShadowCopy certainly is a Windows SBS Killer.  Especially since Microsoft isn't making a 2008 version.  Can I ask for a clarification?  Is ShadowCopy enabled by default then for all users/ibays?  I'd hate to have to enable it manually for every new user.

Once again, nice work all involved.

Steve
Saving the world ... one server at a time.

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Shadow Copy
« Reply #4 on: February 05, 2008, 03:11:36 AM »
steever

Quote
Is ShadowCopy enabled by default then for all users/ibays?
 

Yes, for ibays & users home folders.
...

Offline SoftDux

  • ****
  • 240
  • +0/-0
    • http://www.SoftDux.com
Re: Shadow Copy
« Reply #5 on: March 27, 2008, 08:49:02 PM »
steever
 
Yes, for ibays & users home folders.


So what happens when you add a new user / ibay after setting up shadowcopy? Do you need to remove them manually if you don't want them enabled?

I got a quick question on shadocopy, before using it. Does it simple save the updated files in a hidden folder in the current folder? Let's say I have //intranet/data/docs/clients/client1 and I change a word document in that folder, does it simply add a hidden folder //intranet/data/docs/clients/client1/.shadow/1 to that folder, and the same for //intranet/data/docs/clients/client2 & //intranet/data/docs/clients/client3 ?

But I also understand that it only copies changed files, so not all files are backed up, right? Thus, in essence, it's a live incremental backup, easy for users to quickly restore accidentally deleted files?

And I also presume that all the hidden folders & shadow-copies files will be backed up to the USB backup?

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Shadow Copy
« Reply #6 on: March 27, 2008, 09:37:20 PM »
SoftDux

Howto has been updated, it should answer your questions
http://wiki.contribs.org/ShadowCopy


Quote
I also understand that it only copies changed files, so not all files are backed up, right? Thus, in essence, it's a live incremental backup, easy for users to quickly restore accidentally deleted files?

No not for deleted files, it makes copies of changed files. It does keep old copies, so you can revert to a previous version of the same file.


All data in /home/e-smith/ (which includes the ShadowCopy folders) is included in standard backups.
« Last Edit: March 27, 2008, 10:38:46 PM by RayMitchell »
...

Offline SoftDux

  • ****
  • 240
  • +0/-0
    • http://www.SoftDux.com
Re: Shadow Copy
« Reply #7 on: March 27, 2008, 10:03:26 PM »
Thank you, RayMitchell

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Shadow Copy
« Reply #8 on: March 27, 2008, 10:40:18 PM »
SoftDux

I corrected my earlier post to say
All data in /home/e-smith/ (which includes the ShadowCopy folders) is included in standard backups.
as ShadowCopy folder are in
/home/e-smith/files/.shadow/1
/home/e-smith/files/.shadow/2
etc etc

...

Offline pfloor

  • ****
  • 889
  • +1/-0
Re: Shadow Copy
« Reply #9 on: March 27, 2008, 11:33:08 PM »
ShadowCopy certainly is a Windows SBS Killer.  Especially since Microsoft isn't making a 2008 version....

Really? Maybe someone should tell MS then :-)

http://www.microsoft.com/windowsserver/essential/sbs/default.mspx
In life, you must either "Push, Pull or Get out of the way!"

Offline jptechnical

  • **
  • 68
  • +0/-0
Re: Shadow Copy
« Reply #10 on: February 28, 2009, 11:07:57 PM »
Awesome contrib... thanks for making it so simple for us!!

One question, is is possible to limit the space used by the snapshots? I have a server that is just under half usable disk space, but would like to enable the shadow-copies. Is it possible to specify a quota for that folder or tell the service to only use XX% of the disk space (like Windows Server does)?

Thanks... great software!!!

Offline steever

  • *
  • 185
  • +0/-0
    • Open-Sesame
Re: Shadow Copy
« Reply #11 on: March 01, 2009, 03:08:26 AM »
Quote
Really? Maybe someone should tell MS then :-)
It was true when I posted that comment, a year ago!
Saving the world ... one server at a time.

Offline gedaso

  • 2
  • +0/-0
Re: Shadow Copy
« Reply #12 on: December 08, 2009, 10:37:30 AM »
One question, is is possible to limit the space used by the snapshots? I have a server that is just under half usable disk space, but would like to enable the shadow-copies. Is it possible to specify a quota for that folder or tell the service to only use XX% of the disk space (like Windows Server does)?
I have the same questions   :-?

I enabled shadowcopy per the wiki, and then over the next 24 hours my server happily proceeded to fill up the main drive (which previously was 34% used) with what looks like three snapshots of the entire ibays, even though there had been only minimal changes to some files in this time.

I've now disabled shadowcopy and am in the process of deleting the snapshots to free up space.

Googling for hints, there appears to be other implementations of samba's shadow copies where you can control snap size, free space, size increments etc.  eg http://wiki.samba.org/index.php/Shadow_Copies_with_Snapshots_Script

These options don't seem to appear in the shadow-copy-rotate script in SME Server.  The only options I've found for relate to smb config settings ShadowCount (default 10) and ShadowDir, but can't find any further documentation on these.

Am I missing something in my naive newbiness ?  Is there no way to control the size of the snapshots ?  Why did shadowcopy attempt to make repeated complete copies of my ibays ?   Have I just used up my quota of questions ?

thanks
Geoff