#抢票脚本

shell脚本中:单引号和双引号的区别

前面我们还留下一个疑问,定义变量时,变量的值可以由单引号''包围,也可以由双引号""包围,它们到底有什么区别呢?不妨以下面的代码为例来说明:#!/bin/bashurl="http://c.biancheng.net"website1='C语言中文网:${url}'website2="C语言中文网:${url}"ech...

Shell脚本中执行sql语句操作mysql

对于自动化运维,诸如备份恢复之类的,DBA经常需要将SQL语句封装到shell脚本。本文描述了在Linux环境下mysql数据库中,shell脚本下调用sql语句的几种方法,供大家参考。对于脚本输出的结果美化,需要进一步完善和调整。以下为具体的示例及其方法。1、将SQL语句直接嵌入到shell脚本文件中 复制...

nginx的抓取客户端真实IP的判断脚本

root@nginx-01:/usr/local/nginx/conf/#catproxyheader.confif($proxy_add_x_forwarded_for~"^([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})(.*)"){set$realip$1;}if($pr...

python中的pymongo连接脚本

author:headsenchendate:2019-04-12 17:39:12 先安装python3,pymongo[root@localhostmnt]#cat/root/python-install.sh#!/bin/bashyum-yinstallzlib-develbzip2-deve...

mysql5.6.35的安装脚本

#!/bin/bashfunctionhelp()(cat<<EOF$0[-h]$0-c<CharaterSet>EOFexit1)-------------------------------------------#判断用户是否存在,不存在就新增mysql用户check_and_add_us...
代码星球 ·2020-08-24

cmdb安装脚本

#!/bin/bashcd/tmpyum-yinstalldos2unixcurl-Ohttp://119.254.200.5:7001/downloadversion/1.1.78/cmdbagent-1.1.78-20180712.tar.gztar-zxvfcmdbagent-1.1.78-20180712.ta...
代码星球 ·2020-08-24

parted分区脚本

#!/bin/bash#Usedtofomat6disksPATH=/bin:/sbin:/usr/bin:/usr/sbinexportPATHdisk_to_parted="$1"if[$#==0];thenecho"nodisktoparted,example/dev/sdb"exitelseecho"/n/n*...
代码星球 ·2020-08-24

Python拷贝文件脚本

author:headsenchendate:2018-12-06 17:56:58copy_file.py#!/usr/bin/envpythonfromsysimportargvfromos.pathimportexistsscript,from_file,to_file=argvprint("Copyi...
代码星球 ·2020-08-24

ntpdate自动对准时间的脚本

author:headsen chendate:2018-10-09 19:50:15#!/bin/bashyum-yinstallntpdate/usr/sbin/ntpdatentp.api.bz>/dev/nullhwclock-wecho"11***/usr/sbin/ntpdaten...

salt-ssh的批量脚本及使用方法

author:headsen  chen date:2018-08-02  20:06:061,salt-ssh的安装:    yum-yinstallepel-release    yum...

磁盘挂载自动分区脚本

自动分区脚本:cata.sh#!/bin/bashmkdir/data1echo"np1w"|fdisk/dev/vdc&&mkfs-text4/dev/vdc1 添加到自动挂载:catauto-mount.shecho"UUID=`ls-l/dev/disk/by-uuid|grepvdc1...

tomcat启动脚本

author:headsenchendate:2018-04-10 16:05:05 [root@archtomcat-oss]#cattomcat.sh#!/bin/bashexportJAVA_HOME=/opt/jdk1.7.0_45exportJRE_HOME=${JAVA_HOME}/jr...
代码星球 ·2020-08-24

mysql的增量备份与全备的脚本

mysql全量备份、增量备份。开启mysql的logbin日志功能。在/etc/my.cnf文件中加入以下代码:[mysqld]log-bin="/home/mysql/logbin.log"binlog-format=ROWlog-bin-index="/home/mysql/logindex"binlog_cach...

nginx的自动化安装和启停脚本

个人原创,转载请注明出处和作者,否则依法追究法律责任author:headsenchendate: 2018-03-07 14:39:11nginx_install.sh#!/bin/bashNGINX=nginx-1.9.3.tar.gzuseraddnginxyum-yinstallgcc*pc...

shell脚本基础知识

shell脚本基础知识author:headsenchen  2017-10-19  10:22:15 个人原创,根据老男孩教学视频及老男孩老师的shell编程书籍整理出来的,转载请注明。否则依法追究法律责任1,清除/VAR/LOG/MESSAGES日志的脚本#!/bi...
代码星球 ·2020-08-24
首页上一页...1617181920...下一页尾页