![](https://img-blog.csdnimg.cn/20190927151117521.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
shell
分享一些常用shell脚本
一心想做网管的小白
这个作者很懒,什么都没留下…
展开
-
shell脚本中使用ftp免交互下载文件
在工作中,偶尔会用到使用ftp从其他主机上传下载文件的情况,如果每次手动写的话会很麻烦,此时就可以通过shell脚本来实现。#!/bin/bashhost=192.168.0.1user="root"pass="123456"ftp -i -n -v ${host}<<EOFuser ${user} ${pass}cd /home/data/ #进入远程主机目录lcd ~/tmp/ #进入本机目录binhashmget 123.txtclosebyeEOF原创 2020-06-30 22:58:38 · 781 阅读 · 0 评论 -
常用Shell脚本
一 服务器系统配置初始化需求:设置时区并同步时间禁用selinux清空防火墙默认策略历史命令显示操作时间禁止root远程登录禁止定时任务发送邮件设置最大打开文件数减少swap使用系统内核参数优化安装系统性能分析工具及其他#/bin/bash# 设置时区并同步时间ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtimeif ! crontab -l |grep ntpdate &>/dev/null ; the原创 2020-06-11 00:22:09 · 148 阅读 · 0 评论