Linux檔案備份

來源:互聯網
上載者:User

標籤: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檔案備份

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.