zoukankan      html  css  js  c++  java
  • .csh 脚本在 linux cron 中没有执行

    想要设置一个定时任务,固定更新perfore 下的一个x86shell 的 tree,
    eg: x86shell_sync.csh
    {#!/bin/csh -f
    p4 sync x86shell_dir
    }
    crontab -e {
    0 18 * * * csh -f /project/…./x86shell_sync.csh
    }
    任务设定后, x86shell 的tree 始终没有更新
    原因: x86shell_sync.csh 手动运行的情况下, terminal 已经设好了环境变量,可以识别 p4 sync 命令, 但是定时任务无法自动配置环境变量, p4 sync 因此无效。
    修改方式:在x86shell_sync.csh中添加perforce 的环境变量, 修改后:
    x86shell_sync.csh:
    {#!/bin/csh -f
    setenv P4CLIENT user_p4client
    p4 sync x86shell_dir
    }
    修改之后, 就可以定时更新x86shell 的 tree了。

  • 相关阅读:
    2021-5-14 日报博客
    2021-5-13 日报博客
    2021-5-11 日报博客
    2021-5-10 日报博客
    2021-5-8 周报博客
    团队介绍——北部大队
    周总结4
    梦断代码阅读笔记02
    周总结3
    周总结2
  • 原文地址:https://www.cnblogs.com/yanli0302/p/13845129.html
Copyright © 2011-2022 走看看