日常维护脚本

sh/bash/dash/ksh/zsh等Shell脚本
回复
riptide2012
帖子: 222
注册时间: 2011-12-14 10:21

日常维护脚本

#1

帖子 riptide2012 » 2012-04-30 12:55

平时管理一些片段,感觉还满方便的。分享下

https://github.com/riptide766/maintainance

****************************
日常维护脚本
****************************

通过一定的命名规范,批量或单个执行自定义的函数。

* 组合重用一些系统升级、软件安装和配置等命令。

例如:安装好ubuntu系统后,一条命令完成软件源的添加更新、软件安装和配置

>>> maintainance sources install config

* 收集、重用一些不太常用的命令。

统一放在一个文件相对更好维护(比如:修改和查看)


使用方法
^^^^^^^^^

1. 查询 (支持Tab补全)

**脚本自身不提供任何功能,需要自行添加函数**

>>> manitainance list
_install_software()
_install_dev_software()
_config_home_folder()
_config_sopcast()
_config_bash()
_config_ssh()

>>> maintainance
_config_a _install_a _install_b _sources_a


2. 执行单个函数

执行自定义配置ssh的函数

>>> maintainance _config_ssh


3. 批量执行函数

安装常用软件。(执行所有名字里带install的函数)

>>> maintainance install
invoke ...
1 _install_software()
2 _install_dev_software()
3 _install_air()
4 _install_pomodaireo()
====================================
are you sure?(y/n)

4. 连续的批量执行函数

>>> maintainance sources install
invoke ...
1 _sources_add_repositories()
2 _sources_select()
3 _sources_update()
====================================
are you sure?(y/n) n
invoke ...
1 _install_software()
2 _install_dev_software()
3 _install_air()
4 _install_pomodaireo()
====================================
are you sure?(y/n) n


下载
^^^^^^^

>>> git clone git@github.com:riptide766/maintainance.git
头像
Cherrot
帖子: 981
注册时间: 2011-04-03 10:01
系统: Ubuntu 12.XX
来自: 帝都
联系:

Re: 日常维护脚本

#2

帖子 Cherrot » 2012-05-01 3:05

收藏了 :em11 感谢!
Ubuntu技巧汇总http://wiki.ubuntu.org.cn/UbuntuSkills --你遇到的各种问题可能已经在里面了
我的技术博客http://www.cherrot.com
Code tells you how, comments should tell you why.
shuiwushen
帖子: 2
注册时间: 2012-05-02 13:30

Re: 日常维护脚本

#3

帖子 shuiwushen » 2012-05-22 15:06

果断收藏 :em11
回复