標籤:style blog color os ar strong 檔案 2014 art
1.tar -P是否保留根目錄 -t查看壓縮檔內容 -N 201401010備份日期以後
[[email protected] /]# tar -zcPf /tar/data2.tar.gz /etc/*.conf[[email protected] /]# cd tar/[[email protected] tar]# ll總計 80-rw-r--r-- 1 root root 39051 09-08 23:42 data1.tar.gz-rw-r--r-- 1 root root 39046 09-08 23:43 data2.tar.gz
2.dump -0完全備份
3.restore恢複 -tf查看 -rf恢複
[[email protected] dump]# dump -0 -f /dump/data1.dump /dev/sda1 DUMP: Date of this level 0 dump: Tue Sep 9 00:05:13 2014 DUMP: Dumping /dev/sda1 (/boot) to /dump/data1.dump DUMP: Label: /boot DUMP: Writing 10 Kilobyte records DUMP: mapping (Pass I) [regular files] DUMP: mapping (Pass II) [directories] DUMP: estimated 6512 blocks. DUMP: Volume 1 started with block 1 at: Tue Sep 9 00:05:14 2014 DUMP: dumping (Pass III) [directories] DUMP: dumping (Pass IV) [regular files] DUMP: Closing /dump/data1.dump DUMP: Volume 1 completed at: Tue Sep 9 00:05:14 2014 DUMP: Volume 1 6560 blocks (6.41MB) DUMP: 6560 blocks (6.41MB) on 1 volume(s) DUMP: finished in less than a second DUMP: Date of this level 0 dump: Tue Sep 9 00:05:13 2014 DUMP: Date this dump completed: Tue Sep 9 00:05:14 2014 DUMP: Average transfer rate: 0 kB/s DUMP: DUMP IS DONE[[email protected] dump]#
[[email protected] boot]# restore -tf /dump/data1.dumpDump date: Tue Sep 9 00:05:13 2014Dumped from: the epochLevel 0 dump of /boot on localhost.localdomain:/dev/sda1Label: /boot 2 . 11 ./lost+found 16065 ./grub 16067 ./grub/grub.conf 16066 ./grub/splash.xpm.gz 16068 ./grub/menu.lst 16069 ./grub/device.map 16070 ./grub/stage1 16071 ./grub/stage2 16072 ./grub/e2fs_stage1_5 16073 ./grub/fat_stage1_5 16074 ./grub/ffs_stage1_5 16075 ./grub/iso9660_stage1_5 16076 ./grub/jfs_stage1_5 16077 ./grub/minix_stage1_5 16078 ./grub/reiserfs_stage1_5 16079 ./grub/ufs2_stage1_5 16080 ./grub/vstafs_stage1_5 16081 ./grub/xfs_stage1_5 17 ./initrd-2.6.18-348.el5.img 12 ./.vmlinuz-2.6.18-348.el5.hmac 13 ./System.map-2.6.18-348.el5 14 ./config-2.6.18-348.el5 15 ./symvers-2.6.18-348.el5.gz 16 ./vmlinuz-2.6.18-348.el5
[[email protected] boot]# restore -rf /dump/data1.dump
4.cp命令製作iso檔案
[[email protected] boot]# cp /dev/cdrom /dump/linux.iso
[[email protected] boot]#[[email protected] boot]# mount -o loop /dump/linux.iso /mnt
5.dd命令 -if=輸入裝置 -of=輸出裝置
[[email protected] boot]# dd if=/dev/cdrom of=/dump/linux1.iso
[[email protected] boot]# dd if=/dev/sda of=/dev/sdb #常見的硬碟對拷
Linux檔案備份