本篇介绍一些常用脚本以后会陆续更 SVN钩子 12345678#!/bin/shREPOS="$1"REV="$2"DIR='路径地址'export LANG=en_US.UTF-8CURDATE='date'echo "Code Deployed By at $CURDATE,$REPOS,$REV" >> /var/log/svn.log ## 写入日志svn update $DIR --username 账号 --password 密码 Mysql备份12345678910111213#!/bin/bash# 数据库认证user="root"password="PASSWORD"host=“127.0.0.1”db_name="DBNAME"# 其它backup_path="备份地址"date=$(date +"%d-%b-%Y")# 设置导出文件的缺省权限umask 177# Dump数据库到SQL文件mysqldump --user=$user --password=$password --host=$host $db_name > $backup_path/$db_name-$date.sql iterm下服务器自动登录123456789101112#!/usr/bin/expect -fset user 账号set host IPset password 密码set port 22set timeout -1spawn ssh -p $port $user@$hostexpect "*assword:*"send "$password\r"interactexpect eof Tags: Shell ← php常见关键字 yii入坑 →