tar-snapshot-edit.texi
来自「gnu tar 源码包。 tar 软件是 Unix 系统下的一个打包软件」· TEXI 代码 · 共 59 行
TEXI
59 行
@c This is part of the paxutils manual.@c Copyright (C) 2007 Free Software Foundation, Inc.@c This file is distributed under GFDL 1.1 or any later version@c published by the Free Software Foundation.@cindex Device numbers, changing@cindex snapshot files, editing@cindex snapshot files, fixing device numbers Sometimes device numbers can change after upgrading your kernelversion or recofiguring the harvare. Reportedly this is the case with some newer @i{Linux} kernels, when using @acronym{LVM}. In majority ofcases this change is unnoticed by the users. However, it influences@command{tar} incremental backups: the device number is stored in tarsnapshot files (@pxref{Snapshot Files}) and is used to determine whetherthe file has changed since the last backup. If the device numberschange for some reason, the next backup you run will be a full backup.@pindex tar-snapshot-edit To minimize the impact in these cases, GNU @command{tar} comes withthe @command{tar-snapshot-edit} utility for inspecting and updatingdevice numbers in snapshot files. The utility, written byDustin J.@: Mitchell, is available from@uref{http://www.gnu.org/@/software/@/tar/@/utils/@/tar-snapshot-edit.html,@GNUTAR{} home page}. To obtain the device numbers used in the snapshot file, run @smallexample$ @kbd{tar-snapshot-edit @var{snapfile}}@end smallexample@noindentwhere @var{snapfile} is the name of the snapshot file (you can supply as manyfiles as you wish in a single command line ).To update all occurrences of the given device number in the file, use@option{-r} option. It takes a single argument of the form@samp{@var{olddev}-@var{newdev}}, where @var{olddev} is the device numberused in the snapshot file, and @var{newdev} is the corresponding new devicenumber. Both numbers may be specified in hex (e.g., @samp{0xfe01}),decimal (e.g., @samp{65025}), or as a major:minor number pair (e.g.,@samp{254:1}). To change several device numbers at once, specify themin a single comma-separated list, as in@option{-r 0x3060-0x4500,0x307-0x4600}.Before updating the snapshot file, it is a good idea to create a backupcopy of it. This is accomplished by @samp{-b} option. The name of thebackup file is obtained by appending @samp{~} to the original file name.An example session:@smallexample$ @kbd{tar-snapshot-edit /var/backup/snap.a}file version 2/tmp/snap: Device 0x0306 occurs 634 times.$ @kbd{tar-snapshot-edit -b -r 0x0306-0x4500 /var/backup/snap.a}file version 2@end smallexample
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?