LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: xsam

求助:如何备份系统

[复制链接]
发表于 2009-9-22 02:45:12 | 显示全部楼层
额。。貌似默认就不会不管链接文件吧。

我根本没有注意过这个问题,也没见什么东西少了。
回复 支持 反对

使用道具 举报

发表于 2009-9-22 19:35:17 | 显示全部楼层
@jiuny0209  我现在也是这么打算的,可否分享你的脚本?
回复 支持 反对

使用道具 举报

发表于 2009-9-22 20:18:48 | 显示全部楼层
我对lfs如下操作
备份: # tar cjpf lfs.tar.bz2 /mnt/lfs
恢复: # tar jxpf lfs.tar.bz2
(加上p参数为了保留权限)

可以类推
回复 支持 反对

使用道具 举报

发表于 2009-9-23 14:58:44 | 显示全部楼层
Post by rem1x;2029228
@jiuny0209  我现在也是这么打算的,可否分享你的脚本?


愕!我只是把安裝過程的指令一個一個打上去而已,讓你見笑了

執行make restore 把設定檔取回到./source
執行make sync 安裝系統


  1. cfg=./source
  2. gg=./ggsource
  3. home=$$HOME
  4. pkg=./repopkg

  5. #(修補設定的取回&設定) (1:1的同步安裝系統)
  6. install : instconfig
  7. restore : resconfig
  8. sync : syncpkg syncrepo syncmodule

  9. #設定所有的設定
  10. instconfig :
  11. #安裝目錄(只有軟體的,與系統規劃無關,系統規劃的寫在~/.profile)
  12.         -mkdir -p $(home)/.config/awesome $(home)/.config/Terminal $(home)/.centerim $(home)/.irssi $(home)/.config/Thunar $(home)/.mldonkey $(home)/.aria2
  13. #kernel主要的
  14.         -cp $(cfg)/sysctl.conf /etc/sysctl.conf -v
  15. #BSD主要的
  16.         -cp $(cfg)/rc.conf /etc/rc.conf -v
  17.         -cp $(cfg)/rc.local /etc/rc.local -v
  18.         -cp $(cfg)/gpm /etc/conf.d/gpm -v
  19. #cron主要的
  20.         -crontab $(cfg)/root
  21.         -cp $(cfg)/syncdb /etc/cron.d/syncdb -v
  22.         -cp $(cfg)/abs /etc/cron.d/abs -v
  23.         -cp $(cfg)/update /etc/cron.d/update -v
  24.         -cp $(cfg)/trash /etc/cron.d/trash -v
  25.         -cp $(cfg)/scavenge /etc/cron.d/scavenge -v
  26.         -cp $(cfg)/ntpdate /etc/cron.daily/ntpdate -v
  27. #at主要的
  28.         -rsync -azcvP --delete $(cfg)/atd /var/spool
  29. #網路主要的
  30.         -cp $(cfg)/hosts /etc/hosts -v
  31.         -cp $(cfg)/pacman.conf /etc/pacman.conf -v
  32.         -cp $(cfg)/mirrorlist /etc/pacman.d/mirrorlist -v
  33.         -cp $(cfg)/makepkg.conf /etc/makepkg.conf -v
  34.         -cp $(cfg)/abs.conf /etc/abs.conf -v
  35. #xorg主要的
  36.         -cp $(cfg)/xorg.conf /etc/X11/xorg.conf -v
  37.         -cp $(cfg)/.Xmodmap $(home)/.Xmodmap -v
  38.         -cp $(cfg)/config.scim $(home)/.scim/config -v
  39.         -cp $(cfg)/.xbindkeysrc $(home)/.xbindkeysrc -v
  40.         -cp $(cfg)/44-wqy-zenhei.conf /etc/fonts/conf.d/44-wqy-zenhei.conf -v
  41.         -cp $(cfg)/rc.lua $(home)/.config/awesome/rc.lua -v
  42.         -cp $(cfg)/.xinitrc $(home)/.xinitrc -v
  43.         -cp $(cfg)/.Xdefaults $(home)/.Xdefaults -v
  44.         -cp $(cfg)/.gtkrc.mine $(home)/.gtkrc.mine -v
  45.         -cp $(cfg)/.gtkrc-2.0 $(home)/.gtkrc-2.0 -v
  46. #applications主要的
  47.         -rsync -azcvP --delete $(cfg)/applications $(home)/.local/share
  48. #shell主要的
  49.         -cp $(cfg)/.profile $(home)/.profile -v
  50.         -cp $(cfg)/.bashrc $(home)/.bashrc -v
  51.         -cp $(cfg)/.inputrc $(home)/.inputrc -v
  52.         -cp $(cfg)/.screenrc $(home)/.screenrc -v
  53.         -cp $(cfg)/.pythonstartup $(home)/.pythonstartup -v
  54.         -cp $(cfg)/ipythonrc $(home)/.ipython/ipythonrc -v
  55.         -cp $(cfg)/.irbrc $(home)/.irbrc -v
  56.         -cp $(cfg)/.octaverc $(home)/.octaverc -v
  57. #vim主要的
  58.         -cp $(cfg)/.vimrc $(home)/.vimrc -v
  59.         -cp $(cfg)/.aspell.conf $(home)/.aspell.conf -v
  60. #pdf主要的
  61.         -cp $(cfg)/.apvlvrc $(home)/.apvlvrc -v
  62.         -cp $(cfg)/ev-metadata.xml $(home)/.gnome2/evince/ev-metadata.xml -v
  63. #html主要的
  64.         -cp $(cfg)/prefs.js $(home)/.mozilla/firefox/????????.default/prefs.js -v
  65.         -cp $(cfg)/key3.db $(home)/.mozilla/firefox/????????.default/key3.db -v
  66.         -cp $(cfg)/signons.sqlite $(home)/.mozilla/firefox/????????.default/signons.sqlite -v
  67.         -cp $(cfg)/formhistory.sqlite $(home)/.mozilla/firefox/????????.default/formhistory.sqlite -v
  68.         -cp $(cfg)/permissions.sqlite $(home)/.mozilla/firefox/????????.default/permissions.sqlite -v
  69. #其它
  70.         -cp $(cfg)/fstab /etc/fstab -v
  71. #這個檔案,人工拷貝
  72. #        -cp $(cfg)/downloads.ini $(home)/.mldonkey/downloads.ini -v
  73.         -cp $(cfg)/file_completed_cmd $(home)/.mldonkey/file_completed_cmd -v
  74.         -cp $(cfg)/aria2.conf $(home)/.aria2/aria2.conf -v
  75.         -cp $(cfg)/mplayer.conf /etc/mplayer/mplayer.conf -v
  76.         -cp $(cfg)/config.centerim $(home)/.centerim/config -v
  77.         -cp $(cfg)/config.irssi $(home)/.irssi/config -v
  78.         -cp $(cfg)/.lftprc $(home)/.lftprc -v
  79.         -cp $(cfg)/.surfraw.conf $(home)/.surfraw.conf -v
  80.         -cp $(cfg)/terminalrc $(home)/.config/Terminal/terminalrc -v
  81.         -cp $(cfg)/thunarrc $(home)/.config/Thunar/thunarrc -v
  82.         -cp $(cfg)/.reminders $(home)/.reminders -v
  83.         -cp $(cfg)/.wyrdrc $(home)/.wyrdrc -v
  84. #取回所有的設定
  85. resconfig :
  86. #kernel主要的
  87.         cp /etc/sysctl.conf $(cfg)/sysctl.conf -v
  88. #BSD主要的
  89.         cp /etc/rc.conf $(cfg)/rc.conf -v
  90.         cp /etc/rc.local $(cfg)/rc.local -v
  91.         cp /etc/conf.d/gpm $(cfg)/gpm -v
  92. #cron主要的
  93.         cp /var/spool/cron/root $(cfg)/root -v
  94.         cp /etc/cron.d/syncdb $(cfg)/syncdb -v
  95.         cp /etc/cron.d/abs $(cfg)/abs -v
  96.         cp /etc/cron.d/update $(cfg)/update -v
  97.         cp /etc/cron.d/trash $(cfg)/trash -v
  98.         cp /etc/cron.d/scavenge $(cfg)/scavenge -v
  99.         cp /etc/cron.daily/ntpdate $(cfg)/ntpdate -v
  100. #at主要的
  101.         rsync -azcvP --delete /var/spool/atd $(cfg)
  102. #網路主要的
  103.         cp /etc/hosts $(cfg)/hosts -v
  104.         cp /etc/pacman.conf $(cfg)/pacman.conf -v
  105.         cp /etc/pacman.d/mirrorlist $(cfg)/mirrorlist -v
  106.         cp /etc/makepkg.conf $(cfg)/makepkg.conf -v
  107.         cp /etc/abs.conf $(cfg)/abs.conf -v
  108. #xorg主要的
  109.         cp /etc/X11/xorg.conf $(cfg)/xorg.conf -v
  110.         cp $(home)/.Xmodmap $(cfg)/.Xmodmap -v
  111.         cp $(home)/.scim/config $(cfg)/config.scim -v
  112.         cp $(home)/.xbindkeysrc $(cfg)/.xbindkeysrc -v
  113.         cp /etc/fonts/conf.d/44-wqy-zenhei.conf $(cfg)/44-wqy-zenhei.conf -v
  114.         cp $(home)/.config/awesome/rc.lua $(cfg)/rc.lua -v
  115.         cp $(home)/.xinitrc $(cfg)/.xinitrc -v
  116.         cp $(home)/.Xdefaults $(cfg)/.Xdefaults -v
  117.         cp $(home)/.gtkrc.mine $(cfg)/.gtkrc.mine -v
  118.         cp $(home)/.gtkrc-2.0 $(cfg)/.gtkrc-2.0 -v
  119. #applications主要的
  120.         rsync -azcvP --delete $(home)/.local/share/applications $(cfg)
  121. #shell主要的
  122.         cp $(home)/.profile $(cfg)/.profile -v
  123.         cp $(home)/.bashrc $(cfg)/.bashrc -v
  124.         cp $(home)/.inputrc $(cfg)/.inputrc -v
  125.         cp $(home)/.screenrc $(cfg)/.screenrc -v
  126.         cp $(home)/.pythonstartup $(cfg)/.pythonstartup -v
  127.         cp $(home)/.ipython/ipythonrc $(cfg)/ipythonrc -v
  128.         cp $(home)/.irbrc $(cfg)/.irbrc -v
  129.         cp $(home)/.octaverc $(cfg)/.octaverc -v
  130. #vim主要的
  131.         cp $(home)/.vimrc $(cfg)/.vimrc -v
  132.         cp $(home)/.aspell.conf $(cfg)/.aspell.conf -v
  133. #pdf主要的
  134.         cp $(home)/.apvlvrc $(cfg)/.apvlvrc -v
  135.         cp $(home)/.gnome2/evince/ev-metadata.xml $(cfg)/ev-metadata.xml -v
  136. #html主要的
  137.         cp $(home)/.mozilla/firefox/????????.default/prefs.js $(cfg)/prefs.js -v
  138.         cp $(home)/.mozilla/firefox/????????.default/key3.db $(cfg)/key3.db -v
  139.         cp $(home)/.mozilla/firefox/????????.default/signons.sqlite $(cfg)/signons.sqlite -v
  140.         cp $(home)/.mozilla/firefox/????????.default/formhistory.sqlite $(cfg)/formhistory.sqlite -v
  141.         cp $(home)/.mozilla/firefox/????????.default/permissions.sqlite $(cfg)/permissions.sqlite -v
  142. #其它
  143.         cp /etc/fstab $(cfg)/fstab -v
  144. #這個檔案,人工拷貝
  145. #        cp $(home)/.mldonkey/downloads.ini $(cfg)/downloads.ini -v
  146.         cp $(home)/.mldonkey/file_completed_cmd $(cfg)/file_completed_cmd -v
  147.         cp $(home)/.aria2/aria2.conf $(cfg)/aria2.conf -v
  148.         cp /etc/mplayer/mplayer.conf $(cfg)/mplayer.conf -v
  149.         cp $(home)/.centerim/config $(cfg)/config.centerim -v
  150.         cp $(home)/.irssi/config $(cfg)/config.irssi -v
  151.         cp $(home)/.lftprc $(cfg)/.lftprc -v
  152.         cp $(home)/.surfraw.conf $(cfg)/.surfraw.conf -v
  153.         cp $(home)/.config/Terminal/terminalrc $(cfg)/terminalrc -v
  154.         cp $(home)/.config/Thunar/thunarrc $(cfg)/thunarrc -v
  155.         cp $(home)/.reminders $(cfg)/.reminders -v
  156.         cp $(home)/.wyrdrc $(cfg)/.wyrdrc -v

  157. #安裝所有軟體 (不重裝,不重新下載,不給提示)
  158. syncpkg :
  159. #先加快pacman,增加倉庫,修改下載方式
  160.         cp $(cfg)/mirrorlist /etc/pacman.d/mirrorlist -v
  161.         cp $(cfg)/pacman.conf /etc/pacman.conf -v
  162. #把aur的資源倉庫也收為己用
  163.         -yes | pacman -U -f ./repo/aurbuild/aurbuild-1.8.8-1-any.pkg.tar.gz
  164. #更新系統 (不更新nvidia-96xx裝不了)
  165.         -yes | pacman -Syu
  166. #安裝對時原子鐘
  167.         -yes | pacman -S --needed ntp
  168. #安裝時間管理
  169.         -yes | pacman -S --needed anacron
  170.         -yes | pacman -S --needed at
  171. #安裝消息通知,硬體抽象(不裝這個某些應用程式不能用)
  172.         -yes | pacman -S --needed dbus hal
  173. #安裝Xorg
  174.         -yes | pacman -S --needed xorg xorg-input-drivers nvidia-96xx
  175.         -depmod -a
  176. #安裝字型
  177.         -yes | pacman -S --needed ttf-ms-fonts ttf-dejavu ttf-bitstream-vera wqy-zenhei wqy-bitmapfont
  178. #安裝輸入法
  179.         -yes | pacman -S --needed scim scim-chewing
  180. #安裝圖形庫(缺少主題設定,thunar眼睛看得很吃力,很難分辨,就像沒有語法加亮)
  181.         -yes | pacman -S --needed gtk gtk2 qt
  182.         -yes | pacman -S --needed tango-icon-theme
  183. #安裝磚塊視窗管理
  184.         -yes | pacman -S --needed awesome
  185. #安裝剪貼版
  186.         -yes | pacman -S --needed parcellite
  187. #安裝視窗管理控制
  188.         -yes | pacman -S --needed wmctrl
  189. #安裝按鍵綁定
  190.         -yes | pacman -S --needed xbindkeys
  191. #安裝按鍵模擬
  192.         -yes | pacman -S --needed xvkbd
  193. #安裝虛擬終端機
  194.         -yes | pacmans-S --needed rxvt-unicode
  195.         -yes | pacman -S --needed terminal
  196. #安裝分頁終端機
  197.         -yes | pacman -S --needed screen
  198. #安裝檔案管理
  199.         -yes | pacman -S --needed thunar gamin
  200. #安裝寫程式文書處理
  201.         -yes | pacman -S --needed vim gvim
  202. #安裝拼寫檢查
  203.         -yes | pacman -S --needed aspell aspell-en
  204. #安裝字典
  205.         -yes | pacman -S --needed stardict
  206.         -yes | aurbuild -ns --auto -o "-s" sdcv
  207. #安裝查東西
  208.         -yes | pacman -S --needed surfraw
  209. #安裝本地搜索
  210.         -yes | pacman -S --needed recoll
  211. #安裝看網頁
  212.         -yes | pacman -S --needed flashplugin firefox firefox-i18n
  213. #安裝p2p的下載
  214.         -yes | pacman -S --needed mldonkey
  215. #安裝多線程支持metalink的下載工具
  216.         -yes | pacman -S --needed aria2
  217. #安裝解壓縮
  218.         -yes | pacman -S --needed p7zip
  219. #安裝影片
  220.         -yes | pacman -S --needed mplayer
  221. #安裝網路連鎖
  222.         -yes | pacman -S --needed netcat
  223. #安裝開發腳本語言
  224.         -yes | pacman -S --needed perl python ruby ipython
  225.         -yes | pacman -S --needed bc expect xdialog plan9port gxmessage
  226. #安裝執行java .net
  227.         -yes | pacman -S --needed jre mono
  228. #安裝版本控制系統
  229.         -yes | pacman -S --needed cvs subversion git
  230. #安裝研究論文
  231.         -yes | pacman -S --needed texlive-bin texlive-core texlive-langcjk texlive-fontsextra
  232. #安裝手冊語法加亮
  233.         -yes | pacman -S --needed most
  234. #安裝本文行處理圖片(很多程序用到這個當圖形顯示的程序)
  235.         -yes | pacman -S --needed imagemagick imagemagick-doc
  236. #安裝看圖
  237.         -yes | pacman -S --needed gqview
  238. #安裝計算機
  239.         -yes | pacman -S --needed octave gnuplot
  240. #安裝自動排程
  241.         -yes | pacman -S --needed remind wyrd
  242. #安裝理財
  243.         -yes | pacman -S --needed gnucash
  244. #安裝上ftp
  245.         -yes | pacman -S --needed lftp
  246. #安裝上irc
  247.         -yes | pacman -S --needed irssi
  248. #安裝上www
  249.         -yes | pacman -S --needed w3m
  250. #安裝上mail
  251. #        -yes | pacman -S --needed offlineimap msmtp mutt
  252. #安裝上im
  253.         -yes | pacman -S --needed centerim
  254. #安裝上usenet
  255.         -yes | pacman -S --needed tin
  256. #安裝上rsync
  257.         -yes | pacman -S --needed rsync
  258. #安裝讀電子書(xpdf那包是CMap文件, 文本编码, 和其他各种配置信息)(指沒內含中文字的pdf)
  259.         -yes | pacman -S --needed xpdf xpdf-chinese-simplified xpdf-chinese-traditional
  260. #安裝讀電子書(另一套pdf's rendering,poppler)
  261.         -yes | pacman -S --needed poppler poppler-data apvlv evince kdegraphics-okular
  262. #安裝讀電子書(另一套pdf's rendering,acroread)
  263.         -aurbuild -s --auto acroread
  264. #安裝abs
  265.         -yes | pacman -S --needed abs
  266. #安裝包裝管理工具
  267.         -yes | pacman -S --needed pacman-contrib
  268. #安裝abs的srcpac(目前不能用)
  269.         -yes | pacman -S --needed srcpac
  270. #安裝查包
  271.         -yes | pacman -S --needed pkgtools
  272. #安裝包裝語法分析
  273.         -yes | pacman -S --needed namcap
  274. #安裝抽取tar.gz(fr的repo)
  275.         -yes | pacman -S --needed repacman
  276. #安裝改善pacman(fr的repo)
  277.         -yes | pacman -S --needed pacman-cage
  278. #安裝查模組
  279.         -yes | pacman -S --needed hwdetect
  280. #安裝查硬碟
  281.         -yes | pacman -S --needed hdparm
  282. #安裝查看系統吞吐量
  283.         -yes | pacman -S --needed sysstat
  284. #安裝查看提供的服務器
  285.         -yes | pacman -S --needed nmap
  286. #安裝查看系統資訊
  287.         -yes | pacman -S --needed lshw
  288. #安裝查看溫度電壓資訊
  289.         -yes | pacman -S --needed lm_sensors
  290. #安裝xfrun4
  291.         -yes | pacman -S --needed xfce-utils
  292. #安裝顯示進度
  293.         -yes | pacman -S --needed pv
  294. #暫時丟在這裡
  295.         -yes | pacman -S --needed net-snmp
  296.         -yes | aurbuild -ns --auto -o "-s" octave-forge
  297. #清除快取裡舊版的包
  298.         -yes | pacman -Sc

  299. #安裝自己打得包的軟體,或者是別人打得
  300. syncrepo :
  301. #安裝有hinting的微軟雅黑
  302.         -yes | pacman -U -f $(pkg)/ms-yahei-6.0-1-i686.pkg.tar.gz
  303. #安裝codecs
  304.         -yes | pacman -U -f $(pkg)/all-20071007-1-i686.pkg.tar.gz
  305. #安裝字典
  306.         -yes | pacman -U -f $(pkg)/stardict-langdao-ec-big5-2.4.2-1-i686.pkg.tar.gz
  307.         -yes | pacman -U -f $(pkg)/stardict-langdao-ce-big5-2.4.2-1-i686.pkg.tar.gz
  308. #        -yes | pacman -U -f $(pkg)/stardict-oxford-gb-formated-2.4.2-1-i686.pkg.tar.gz

  309. #安裝膠水語言的modules
  310. syncmodule :

  311. #下載最新的archlinux's 安裝影像檔
  312. getimg :
  313.         echo -e "lcd ./img\ncd /iso/latest\nglob pget -c archlinux-*.*-core-i686.img" | lftp ftp://ftp.archlinux.org
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表