legato之save,recover使用方法

首先看一下save之简单命令:
[root@samba /]# save --?
usage: save [] [path ...]

options: [-BEiLKVSnquvx] [-s server] [-c client-name] [-N name]
[-e expiration time] [-w browse time] [-y retention time]
[-f dirfile] [-b pool] [-F file] [-I input file] [-g group]
[-l level] [-t date] [-m masquerade] [-W width]
[root@samba /]#



查看当前的加载设备的信息
[root@samba etc]# nsrmm -C
4mm DAT72 tape samba.01 mounted on /dev/nst0, write enabled
[root@samba etc]# mminfo -m
state volume written (%) expires read mounts capacity
samba.01 0 KB 0% undef 0 KB 0 12 GB
备份,相对于备份就比较简单
一般情况下如果lgtato的服务端和客户端在一起的话,简单命令如下:
save -b DBMIData -l full /nsr
-b 备份池的名字
-l 备份级别,full为全备
/nsr 为要备份的内容
如果lgtato的服务端和客户端不在一起的话需要加上服务器的名字,例如:
save -s zongbu -b DBMIdata -l full /nsr
-s 即制定服务器的名字,当然这个也需要在本地设制服务器的名字变量,并且需要在服务器端设置对应的客户端和增加license支持
现在来看看具体的备份情况。
我们先在/etc目录下增加一下文件1.txt
[root@samba /]# cd /etc
[root@samba etc]# vi 1.txt
编辑内容为111
[root@samba etc]# ls -al 1.txt
-rw-r--r-- 1 root root 0 12月 23 17:35 1.txt
备份整个/etc目录
[root@samba etc]# save -b DBMIData -l full /etc
修改文件1.txt再备份一次,把aaa变为bbb
[root@samba etc]# vi 1.txt
[root@samba etc]# save -b DBMIData -l full /etc

现在我们来看恢复
[root@samba etc]# recover --help
Usage: recover [-fnqu] [-i {nNyYrR}] [-d destination] [-c client] [-x index-namespace] [-t date] [-s server] [-p pass-phrase] [dir]
or
recover [-fnqu] [-i {nNyYrR}] [-I input file] [-d destination] [-c client] [-x index-namespace] [-t date] [-s server] [-p pass-phrase] -a path...
or
recover [-fnqu] [-i {nNyYrR}] [-d destination] [-s server] [-p pass-phrase] {[-S ssid[/clone id]]...} [path ...]
or
recover [-fq] -i {NYR} -R recover-target [-c client] [-d destination] [-x index-namespace] [-t date] [-s server] [-p pass-phrase] [dir]
[root@samba etc]#
但是这样的恢复命令比较难看懂,我们用比较简单的方法:recover /etc定位到我们备份文件的路径
[root@samba etc]# recover /etc
recover: Current working directory is /etc/
recover> ?
Available commands are:
add [-q] [filename] - add `filename' to list of files to be recovered
cd [dir] - change directory to dir
changetime [date] - change the time that you are browsing
debug
delete [filename] - delete `filename' from the recover list
destination - print destination location for recovered files
dir [/w] [filename...] - list filename
exit - immediately exit program
force - overwrite existing files
help or `?' - print this list
lf [-aAcCdfFgilLqrRsStu1] [filename...] - list filename type
list [-c | -l] - list the files marked for recover
ll [-aAcCdfFgilLqrRsStu1] [filename...] - long list filename
ls [-aAcCdfFgilLqrRsStu1] [filename...] - list filename
noforce - do not overwrite existing files
pwd - print current directory
quit - immediately exit program
recover - recover requested files
relocate [dir] - specify new location for recovered files
verbose - toggle verbose mode; feedback about what is going on
versions [filename] - report on each version of file `filename
volumes [filename] - report volumes needed to recover marked files
`filename' can be either a file or a directory
recover>
输入问号显示命令
现在我们来删除1.txt文件,
[root@samba etc]# rm 1.txt
如果我们想恢复文件内容为bbb的文件比较简单
[root@samba root]# recover /etc
recover: Current working directory is /etc/
recover> add /etc/1.txt
/etc
1 file(s) marked for recovery
recover> recover
recover: Total estimated disk space needed for recover is 4 KB.
Recovering 1 file into its original location
Volumes needed (all on-line):
samba.01 at /dev/nst0
Requesting 1 file(s), this may take a while...
./1.txt
./1.txt file exists, overwrite (n, y, N, Y) or rename (r, R) [n]? y
overwriting ./1.txt
Received 1 file(s) from NSR server `samba'
Recover completion time: 2006年12月23日 星期六 18时00分15秒
recover> q
[root@samba root]# cat /etc/1.txt
bbb
[root@samba root]#
此时恢复的1.txt文件内容为bbb,如果我们想恢复文件内容为aaa的文件:
[root@samba root]# recover /etc
recover: Current working directory is /etc/
recover> ?
Available commands are:
add [-q] [filename] - add `filename' to list of files to be recovered
cd [dir] - change directory to dir
changetime [date] - change the time that you are browsing
debug
delete [filename] - delete `filename' from the recover list
destination - print destination location for recovered files
dir [/w] [filename...] - list filename
exit - immediately exit program
force - overwrite existing files
help or `?' - print this list
lf [-aAcCdfFgilLqrRsStu1] [filename...] - list filename type
list [-c | -l] - list the files marked for recover
ll [-aAcCdfFgilLqrRsStu1] [filename...] - long list filename
ls [-aAcCdfFgilLqrRsStu1] [filename...] - list filename
noforce - do not overwrite existing files
pwd - print current directory
quit - immediately exit program
recover - recover requested files
relocate [dir] - specify new location for recovered files
verbose - toggle verbose mode; feedback about what is going on
versions [filename] - report on each version of file `filename
volumes [filename] - report volumes needed to recover marked files
`filename' can be either a file or a directory
recover> versions

Versions of `/etc/':

8 drwxr-xr-x root root 8192 12月 23 17:56 etc/
save time: Sat Dec 23 17:57:24 2006
location: samba.01 at /dev/nst0

8 drwxr-xr-x root root 8192 12月 23 17:56 etc/
save time: Sat Dec 23 17:56:19 2006
location: samba.01 at /dev/nst0

recover> changetime Sat Dec 23 17:56:19 2006
time changed to Sat Dec 23 17:56:19 2006
recover> force
recover: will overwrite any existing files.
recover> add /etc/1.txt
1 file(s) marked for recovery
recover> recover
recover: Total estimated disk space needed for recover is 4 KB.
Recovering 1 file into its original location
Volumes needed (all on-line):
samba.01 at /dev/nst0
Requesting 1 file(s), this may take a while...
./1.txt
./1.txt: file exists, overwriting
Received 1 file(s) from NSR server `samba'
Recover completion time: 2006年12月23日 星期六 18时06分22秒
recover> q
[root@samba root]# cat /etc/1.txt
aaa
[root@samba root]#
只说一下这个changetime命令
changetime 改变我们要恢复文件的备份时间

如果我们想把这个文件恢复到另外一个目录:
[root@samba /]# recover /etc
recover: Current working directory is /etc/
recover> relocate /root
recover> add /etc/1.txt
/etc
1 file(s) marked for recovery
recover> recover
recover: Total estimated disk space needed for recover is 4 KB.
Recovering 1 file from /etc/ into /root
Volumes needed (all on-line):
samba.01 at /dev/nst0
Requesting 1 file(s), this may take a while...
./1.txt
Received 1 file(s) from NSR server `samba'
Recover completion time: 2006年12月23分 星期六 18时14分52秒
recover> q
[root@samba /]# cat /root/1.txt
bbb
[root@samba /]#

里面还有其它的一下命令可以用,可以自己练习

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/312079/viewspace-245572/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/312079/viewspace-245572/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值