Skip to content

Instantly share code, notes, and snippets.

@ibreathebsb
Created August 29, 2018 00:46
Show Gist options
  • Save ibreathebsb/0cee8bf110e38219e1fff7d4b0eac011 to your computer and use it in GitHub Desktop.
Save ibreathebsb/0cee8bf110e38219e1fff7d4b0eac011 to your computer and use it in GitHub Desktop.

dump

文件和文件系统备份

dump -W 列出/etc/fstab中的文件系统备份情况

root@debian-gnu-linux-vm:/home/parallels/Playground# dump -W
Last dump(s) done (Dump '>' file systems):
  /dev/sda1	(     /) Last dump: never
  

dump [options] file/filesystem

-[level]: 0 ~ 9, 0全量备份,其余为增量备份

-f [备份生成的文件]: 可以是设备、常规文件、或者-(表示standard output)

-u : 更新备份时间表通常为/etc/dumpdates,debian中为/var/lib/dumpdates

-v: 可视化显示进程

-j/z: 启用bzip2/gzip压缩

-S: 只对本次备份需要的空间进行预估,而不进行实际备份操作

restore

dump还原工具

restore -t [-f dumpfile] 查看dumpfile中的内容

restore -r [-f dumpfile] 恢复整个文件系统

restore -C [-f dumpfile] -D [挂载点] 将dumpfile中的文件与挂载点的文件系统对比,列出不同点

dd

dd if=[src] of=[dest] bs=[blcok size] count=[count]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment