Tool

tbackup.sh

tool
Reads:

2275

Score:
0
0
 
Comments:

2

license: 
Free

by peter hine

I noticed that while the rights facility under Linux was useful for telling you the rights for a particular directory, it wasn't suitable or really useful for anything more. NetWare has trustees.nlm that can backup a volumes trustees to a XML sheet, but Linux doesn't have that. Simply backing up the
.XML sheet in ._NETWARE directory and copying it back in when needed (or editing it to add particular trustees) only worked occasionally.

I was desiring a tool that would record the current rights in a way that tbackup.exe used to do (when it worked). So here it is.

The ZIP file includes tbackup.sh.

Usage:

tbackup.sh [-f dir] [-r]
Creates a trestore.sh in the root of each volume unless -f is used.
-r relative. Don't include the /media/nss directory.
-f do one directory only, by default program does every volume in /media/nss.

Example output of what trestore.sh would look like:

#!/bin/bash
# Restore rights to volume DATA
rights -f "/media/nss/DATA" -r  irf
rights -f "/media/nss/DATA/apps" -r rf trustee
".CN=Deploy.OU=SubOU.OU=Network.O=Company.T=COMPANY_TREE"

rights -f "/media/nss/DATA/deploy" -r rf trustee
".CN=Deploy.OU=SubOU.OU=Network.O=Company.T=COMPANY_TREE"

rights -f "/media/nss/DATA/user/TestScoundrel" -r rwcefm trustee
".CN=TestScoundrel.OU=OU2.OU=Location.O=Company.T=COMPANY_TREE"
AttachmentSize
tbackup.zip2.7 KB




User Comments

cpashupathinath's picture

tbackup is not working

Submitted by cpashupathinath on 8 April 2009 - 11:13pm.

Hi,

I just tried using tbackup.sh, but throws errors.

systst-ts-53:~ # sh tbackup.sh
find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.

tbackup.sh: line 97: /tmp/t.txt: No such file or directory

systst-ts-53:~ # sh tbackup.sh -r
find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.

tbackup.sh: line 97: /tmp/t.txt: No such file or directory

systst-ts-53:~ # sh tbackup.sh -r -f
Internal error !
systst-ts-53:~ #

any help is appreciated.

CP

Read the warning message

Submitted by mpjames on 28 July 2009 - 3:06pm.

Read the warning message 1st, and let's do what it says -- we'll need to put the maxdepth option before the type option. Edit tbackup.sh and find line 226
Change it from:
for VOL in `find /media/nss -type d -maxdepth 1`; do

To:
for VOL in `find /media/nss -maxdepth 1 -type d`; do

Save your changes and go.

© 2009 Novell, Inc. All Rights Reserved.