动态网站制作指南 [  QQ表情  ]
[ 投票调查 ]
[ 企业邮箱 ]
[ 网站空间 ]
网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
ASP源码 | .Net源码 | PHP源码 | JSP源码 | JAVA源码 | CGI源码 | VB源码 | C++源码 | Delphi源码 | PB源码 | VF源码 | 汇编 | 服务器
电脑书籍下载:程序设计书籍 | 数据库教程书籍 | 平面与多媒体书籍 | 网络通讯书籍 | 系统管理书籍 | 网络安全书籍 | 认证考试书籍
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 软件工程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
文章搜索服务
邮件订阅
输入你的邮件地址,
你将不会错过任何关于:
[ 软件工程 ]的信息



本月文章推荐
.历史十大黑客事件:不堪一击的系.
.新上任项目经理遇到的难题.
.企业信息化大路子是不是搞反了?.
.软件工程的七条基本原理.
.软件系统分析的方法和策略.
.选择SOA的原因和时机(1).
.关于软件原型方法若干问题的讨论.
.2007年值得去思考的N大软件技术.
.BEA推出架构集成和SOA管理方面的.
.通过服务模拟来简化SOA开发(1).
.UML用例建模的慨念和应用.
.软件自动化测试实例分析.
.利用微软Atlas消费外部Web服务.
.一流软件领导的10个特征.
.Tor 技术和 Torpark 浏览器.
.使用.NET智能版进行SIM编程.
..NET Framework中的串行化操作.
.深入分析ADO.NET中的DataSet对象.
.ISO9000:2000 质量管理八大原则(.
.使用软件工程学来开发软件.

备份Gentoo Linux的脚本,适用其他Linux的备份

发表日期:2008-3-23 |


#!/bin/bash
# Backup script for Gentoo Linux
# Author: Reto Glauser aka blinkeye
# Homepage: http://blinkeye.ch
# Mailto: stage4 at blinkeye dot ch
# Date: 23.03.2005
# If you need further infos check out this post: http://forums.gentoo.org/viewtopic.PHP?p=1751698#1751698

version=v1.2

# these are the commands we actually need for the backup
command_list="echo tar hostname date split"

# verify that each command we use exists
for command in $command_list; do
        path=`which $command grep "no $command in"`

        if [ ! -x `which $command` -a "$path" ]; then
                echo -e "\n\nERROR: $command not found! Check your commands and/or your \$PATH"
                exit -1
        fi
done

# options for the tar command
tarOptions="--create --absolute-names --preserve-permissions --totals --bzip2 --ignore-failed-read --verbose --file"

# where to put the stage4
stage4Location=/mnt/backup/stage4

# name prefix
stage4prefix=$(hostname)-stage4-`date +\%d.\%m.\%Y`

# these files/Directories are always excluded
default_exclude_list="
--exclude=/tmp/*
--exclude=/var/tmp/*
--exclude=/lost+found/*
--exclude=/dev/*
--exclude=/proc/*
--exclude=/mnt/*
--exclude=/sys/*
--exclude=/usr/portage/*
--exclude=/var/log/*
--exclude=$stage4Location"

# depending on your choice these files or directories will additionally be excluded
custom_exclude_list="
--exclude=/usr/src/*
--exclude=/opt/mathematica
--exclude=/usr/share/smssend
--exclude=/home/*"

# check the folder/files stored in $default_exclude_list exist
for exclude in $default_exclude_list; do
        if [ ! -e "`echo "$exclude" cut -d'=' -f2 cut -d'*' -f1`"  ]; then
                echo -e "\n\nERROR: `echo "$exclude" cut -d'=' -f2` not found! Check your \$default_exclude_list"
        fi
done

# check the folder/files stored in $custom_exclude_list exist
for exclude in $custom_exclude_list; do
        if [ !
-e "`echo "$exclude" cut -d'=' -f2 cut -d'*' -f1`"  ]; then
                echo -e "\n\nERROR: `echo "$exclude" cut -d'=' -f2` not found! Check your \$custom_exclude_list"
        fi
done

# print out the version
 echo -e "\nBackup script $version"
 echo -e "==================="


# how do you want to backup?
echo -e "\nWhat do you want to do? (Use CONTROL-C to abort)\n
(1) Minimal backup
(2) Interactive backup"

while [ "$option" != '1' -a "$option" != '2'  ]; do
        echo -en "\nPlease enter your option: "
        read option
done

case $option in
1)
        stage4Name=$stage4Location/$stage4prefix-minimal
        final_command="tar $default_exclude_list $custom_exclude_list $tarOptions $stage4Name.tar.bz2 / /var/log/emerge.log"
        ;;
2)
        for folder in $custom_exclude_list; do
                echo -en "Do you want to backup" `echo "$folder" cut -d'=' -f2`"? (y/n) "
                read answer
                while [ "$answer" != 'y' -a "$answer" != 'n' ]; do
                        echo "please enter y or n"
                        read answer
                done
                if [ "$answer" == 'n' ]; then
                        default_exclude_list="$default_exclude_list $folder"
                fi
        done

        stage4Name=$stage4Location/$stage4prefix-custom
        final_command="tar $default_exclude_list $tarOptions $stage4Name.tar.bz2 /  /var/log/emerge.log"
        ;;
esac

# show what will be done
echo -e "\n* creating the stage4 at $stage4Location with the following options:\n\n"$final_command

# everything is set, are you sure to continue?
echo -ne "\nDo you want to continue? (y/n) "
read answer
while [ "$answer" !
= 'y' ] && [ "$answer" != 'n' ]; do
                        echo "please enter y or n"
                        read answer
done

if [ "$answer" == 'y' ]; then
        # mount boot
        echo -e "\n* mount boot"
        mount /boot >/dev/null 2>&1

        # if necessary, create the stage4Location
        if [ ! -d "$stage4Location" ] ; then
                echo "* creating directory $stage4Location"
                mkdir -p $stage4Location
        fi

        # check whether the file already exists
        if [ -a "$stage4Name.tar.bz2" ]; then
                echo -en "\nDo you want to overwrite $stage4Name.tar.bz2? (y/n) "
                read answer
                while [ "$answer" != 'y' ] && [ "$answer" != 'n' ]; do
                        echo "please enter y or n"
                        read answer
                done
                if [ "$answer" == 'n' ]; then
                        echo -e "\n* There's nothing to do ... Exiting"
                        exit 0;
                fi
        fi

        # do the backup
 
       time $final_command

        # copy the current world file to the stage4 location
        echo -e "\n* creating stage4 overview $stage4Name.txt"
        cp /var/lib/portage/world $stage4Name.txt >/dev/null 2>&1

        # we finished, clean up
        echo "* stage4 is done"
        echo "* umounting boot"
        umount /boot
else
        echo -e "\n* There's nothing to do ... Exiting"
fi

#Uncomment the following command if you want to split the archive in cd size chunks:
#split --suffix-length=1 --bytes=670m $stage4Name.tar.bz2 "$stage4Name".tar.bz2_ && echo "* splitting is done"
上一篇:Linux-C-Socket编程 人气:297
下一篇:AntiVir表现不错!(第1版) 人气:221
浏览全部软件工程的内容 Dreamweaver插件下载 常用网页广告代码全集
  最新网站源码 最新软件下载
2008-7-25 WikyBlog v1.7.0.1 多国语言版
2008-7-25 乐彼网上开店系统(56770 Eshop)
2008-7-25 赛特网站管理系统sitecms v3.6.0
2008-7-25 Modoer多功能点评系统 v1.0.1 Bu
2008-7-25 Shangducms Teamsuit! v1.1.0 开
2008-7-25 幻影动漫网视频系统(Ppdong) v1.
2008-7-25 acteecompany企业网站建设系统 v
2008-7-25 恒浪整合管理系统 ims v4.1 ACCE
2008-7-25 艺术图库系统 v1.0 beta
2008-7-19 UltraEdit 简体中文增强版 14.10
2008-7-19 CentOS 5.2 i386 LiveCD
2008-7-19 Snapture多功能相机 v1.4
2008-7-19 iAcces中文输入法 v1.0Build016
2008-7-19 Cookbook烹饪秘籍 v2.5
2008-7-19 苹果专用DVD转换工具 v1.1.59汉化
2008-7-19 Modem修复软件ZiPhone修改版04.0
2008-7-19 AgileMessenger即时通讯工具美化
2008-7-19 Sketches画图软件 v0.7b6破解版


  发表评论
姓 名: 验证码:
内 容:
[ 汉字翻译拼音 ] [ 广告代码 ] [ 符号对照表 ] [ 进制转换 ] [ 经典小工具 ] [ 个税计算 ] [ 汉字简繁转换 ] [ 普通单位换算 ] [ 公制单位换算 ]
[ 生辰老黄历 ] [ 国内电话区号 ] [ 国家代码与域名缩写 ] [ 文字加密解密 ] [ 健康查询 ] [ 万年历 ] [ 手机号码查询 ] [ ip搜索 ] [ Google PR查询 ]
业务联系 | 广告刊登 | 频道合作 | 投稿荐稿 | 联系方式 | 加入收藏 | RSS订阅
Copyright © 2000-2008 www.knowsky.com All rights reserved | 网络实名:动态网站制作指南 | 沪ICP备05001343号
ホームページ制作 不動産検索システム 求人情報
防水工事·改修工事 フットサル大会 探偵