随笔分类 - 脚本相关
摘要:linux执行crotab是python脚本不生效解决方案 原因: 环境变量没有加载 解决方案: 1、使用shell脚本去执行python脚本 2、脚本内容路径需要绝对路径 3、加载环境变量:source /etc/profile 如: #!/bin/bashsource /etc/profilec
阅读全文
摘要:#!/bin/sh myPath="/var/log/httpd/" myFile="/var /log/httpd/access.log" #这里的-x 参数判断$myPath是否存在并且是否具有可执行权限 if [ ! -x "$myPath"]; then mkdir "$myPath" fi
阅读全文