首页
关于
Search
1
sublime 3155-3175 LICENSE
7,707 阅读
2
mysql存储过程&时间累加插入
7,613 阅读
3
在投射和录制时显示敏感信息写给TeamViewer,anydesk,向日葵
6,984 阅读
4
永远不要相信浮点数结果精确到了最后一位,也永远不要比较两个浮点数是否相等。
4,436 阅读
5
mysql-workbench中duration fetch的含义
4,377 阅读
ubuntu
centos
sublime
php
mysql
JS
CSS
其他
chrome
redis
登录
Search
标签搜索
mysql
curl
grep
journalctl
rename
only_full_group_by
警示
dropbox
mtr
curl抓取重定向
floor
intval
ceil
round
pixmap
adwaita
date.utc
gmmktime
unity8
查询自定义字段
五好的Book
累计撰写
180
篇文章
累计收到
24
条评论
首页
栏目
ubuntu
centos
sublime
php
mysql
JS
CSS
其他
chrome
redis
页面
关于
搜索到
21
篇与
的结果
2017-04-27
一个同步所有网站的shell脚本
背景:网站由a/b开头命名,实现的功能为 根据用户输入: 网站的类型,原文件的路径,复制到文件的目录,达到同步的目的,对用户输入做了是否是目录/文件的基本检查,如果条件不满足则给予提示信息。cd /home/www #进入目标目录 echo "please input enter site type:(a/b)" #提示用户输入网站类型 read type if [ "$type" == "" ] #判断用户输入的类型,如果为空则为所有网站否则为指定类型的网站 then type="*" fi echo "please input need to copy files path:" #提示用户输入源文件的地址 read file if [ -f "$file" ]#作出是否是文件的判断 then echo "please input site path:"#提示用户输入要复制到的目录 read path ls=`ls -d $type.www.*`#得到/home/www下指定的目录 #for dir in `find -type d -name "a.*" -o -name "b.*"` for dir in $ls do if [ -d "./$dir/$path" ]#对目录做检查 then echo "cp $file ./$dir/$path" #执行复制,,, else echo "sorry you enter the path is not path"#错误提示信息 fi done else echo "sorry you enter the file is not file"#错误提示信息 fi
2017年04月27日
957 阅读
0 评论
0 点赞
1
...
4
5