Difference between revisions of "ShadowCopy"
RayMitchell (talk | contribs) (Added ShadowCopy Contrib Howto) |
|||
(17 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
== ShadowCopy == | == ShadowCopy == | ||
− | + | ShadowCopy takes a snapshot of ibays and user home folders at scheduled intervals and allows network users to restore previous versions of files via the Windows Explorer file properties page. | |
+ | This works for Windows XP and above. | ||
− | + | To obtain a client for Windows 2000SP3+ download from [http://technet.microsoft.com/en-gb/windowsserver/bb405951.aspx here]. | |
− | |||
− | |||
− | + | ===RPM version requirements=== | |
− | + | This functionality is included in e-smith-samba since version 1.14.0-20. | |
− | |||
− | |||
− | |||
− | This functionality is included in e-smith-samba | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
To check the installed rpm version | To check the installed rpm version | ||
− | rpm - | + | rpm -q e-smith-samba |
− | On a | + | On a SME Server 7.3 server this gives |
e-smith-samba-1.14.1-3.el4.sme | e-smith-samba-1.14.1-3.el4.sme | ||
− | so the installed rpm is more recent than that required | + | so the installed rpm is more recent than that required. |
+ | ===Configuration=== | ||
+ | ====Enabling and disabling==== | ||
Initially disable ShadowCopy for specific ibays or users you don't wish to take snapshots for | Initially disable ShadowCopy for specific ibays or users you don't wish to take snapshots for | ||
eg | eg | ||
Line 39: | Line 27: | ||
db accounts setprop ibay2 ShadowCopy disabled | db accounts setprop ibay2 ShadowCopy disabled | ||
− | Note | + | {{Note box|For the script to work correctly, leave two or more users enabled.}} |
+ | |||
+ | To re-enable any disabled ibays or users do: | ||
+ | db accounts delprop user1 ShadowCopy | ||
+ | db accounts delprop ibay2 ShadowCopy | ||
Then enable and expand templates | Then enable and expand templates | ||
config setprop smb ShadowCopy enabled | config setprop smb ShadowCopy enabled | ||
− | signal-event ibay-modify | + | config setprop smb WideLinks on |
+ | signal-event ibay-modify | ||
+ | =====WideLinks===== | ||
+ | Samba 3.5 changed the default for WideLinks to no, this tightens security to prevent symbolic links seeing outside the directory root. ShadowCopy itself will work without this setting, but will require shell access to restore files.. | ||
+ | |||
+ | ====Adding ibays and users to your server==== | ||
+ | Add ibays and users to your sme server in the normal way. If ShadowCopy is enabled, then by default the newly added ibays and users will be included in ShadowCopy behaviour, so you must specifically exclude them from ShadowCopy behaviour using the disable commands mentioned above on a per ibay and user basis. | ||
+ | |||
+ | |||
+ | ====Snapshots==== | ||
You need to schedule shadow copy to take snapshots. | You need to schedule shadow copy to take snapshots. | ||
You can do this manually from the command prompt | You can do this manually from the command prompt | ||
Line 52: | Line 53: | ||
At the command prompt do | At the command prompt do | ||
/etc/e-smith/events/actions/shadow-copy-rotate | /etc/e-smith/events/actions/shadow-copy-rotate | ||
− | + | {{Note box|You will need enough free disk space [and backup capacity] to take a copy of the entire /home/e-smith/files directory plus any changes that take place.}} | |
− | Note | ||
− | A | + | ====Setup Cron==== |
+ | A cron job that runs the script every hour from 10am to 5pm on weekdays would contain the following. Adjust to suit your requirements. | ||
Create a file | Create a file | ||
Line 78: | Line 79: | ||
/etc/init.d/crond restart | /etc/init.d/crond restart | ||
− | + | ====Location of ShadowCopy files==== | |
− | |||
− | |||
− | |||
− | |||
− | |||
+ | NB. Users recover files with windows explorer. | ||
− | ShadowCopy files are located in: | + | The ShadowCopy files are located in: |
/home/e-smith/files/.shadow/1 | /home/e-smith/files/.shadow/1 | ||
/home/e-smith/files/.shadow/2 | /home/e-smith/files/.shadow/2 | ||
Line 95: | Line 92: | ||
Note that a new snapshot is only taken if files have changed. | Note that a new snapshot is only taken if files have changed. | ||
+ | ===Bugs=== | ||
+ | If you find a problem report it to the bug tracker at bugs.contribs.org | ||
− | + | ===References=== | |
− | |||
+ | [[bugzilla:1549]] | ||
− | + | [[bugzilla:6858]] Wide Links | |
− | http:// | + | [http://forums.contribs.org/index.php?topic=39954.0 Shadow Copy topic in the Contribs forums] |
− | + | For background information regarding alternative Linux implementation, although this contrib is not used here | |
− | |||
− | For background information | ||
http://www.wlug.org.nz/SambaShadowCopyHowto | http://www.wlug.org.nz/SambaShadowCopyHowto | ||
− | |||
---- | ---- | ||
− | [[Category: | + | [[Category:Howto]] |
− | [[Category: Backup]] | + | [[Category:Backup]] |
+ | [[Category:Administration:File and Directory Access]] |
Latest revision as of 23:17, 30 June 2013
ShadowCopy
ShadowCopy takes a snapshot of ibays and user home folders at scheduled intervals and allows network users to restore previous versions of files via the Windows Explorer file properties page.
This works for Windows XP and above.
To obtain a client for Windows 2000SP3+ download from here.
RPM version requirements
This functionality is included in e-smith-samba since version 1.14.0-20.
To check the installed rpm version
rpm -q e-smith-samba
On a SME Server 7.3 server this gives e-smith-samba-1.14.1-3.el4.sme so the installed rpm is more recent than that required.
Configuration
Enabling and disabling
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
To re-enable any disabled ibays or users do:
db accounts delprop user1 ShadowCopy db accounts delprop ibay2 ShadowCopy
Then enable and expand templates
config setprop smb ShadowCopy enabled config setprop smb WideLinks on signal-event ibay-modify
WideLinks
Samba 3.5 changed the default for WideLinks to no, this tightens security to prevent symbolic links seeing outside the directory root. ShadowCopy itself will work without this setting, but will require shell access to restore files..
Adding ibays and users to your server
Add ibays and users to your sme server in the normal way. If ShadowCopy is enabled, then by default the newly added ibays and users will be included in ShadowCopy behaviour, so you must specifically exclude them from ShadowCopy behaviour using the disable commands mentioned above on a per ibay and user basis.
Snapshots
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.
At the command prompt do
/etc/e-smith/events/actions/shadow-copy-rotate
Setup Cron
A cron job that runs the script every hour from 10am to 5pm on weekdays would contain the following. Adjust to suit your requirements.
Create a file
pico -w /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
To save
Ctrl o
To exit
Ctrl x
After saving the above script do
/etc/init.d/crond restart
Location of ShadowCopy files
NB. Users recover files with windows explorer.
The ShadowCopy files are located in:
/home/e-smith/files/.shadow/1 /home/e-smith/files/.shadow/2 /home/e-smith/files/.shadow/3 and so on...
The number of subfolders depends on how many snapshots have been taken.
Note that a new snapshot is only taken if files have changed.
Bugs
If you find a problem report it to the bug tracker at bugs.contribs.org
References
bugzilla:6858 Wide Links
Shadow Copy topic in the Contribs forums
For background information regarding alternative Linux implementation, although this contrib is not used here
http://www.wlug.org.nz/SambaShadowCopyHowto