我正在尝试使用 crontab 安排包含以下命令的 shell 脚本 (batch1.sh):
/opt/teradata/client/14.10/datamover/commandline/datamove start -job_name DM_JOB_PROPOSAL_CREDIT_LIMIT -sync > /home/dmuser/BAF_dev/production/test_CS/batch1.out 2>&1
命令 datamove 是 Teradata datamover 命令。
以下是用于安排脚本的 crontab 条目:
#!/bin/bash
57 15 * * * /home/dmuser/BAF_dev/production/test_CS/batch1.sh
我收到“无法访问 DmCommandline.jar”错误。
crontab -l 的输出:
#DO NOT EDIT THIS FILE - edit the master and reinstall.
#(/tmp/crontab.XXXX4NWuZV installed on Thu Apr 3 15:55:46 2014)
#(Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
#50 18 * * * CMD datamove start -job_name DM_JOB_LIMIT_DETAILS -sync >> /home/out.out
#18 19 * * * sh /home/dmuser/BAF_dev/production/01042014_ZA/batch1.sh
#!/bin/bash
57 15 * * * /home/dmuser/BAF_dev/production/test_CS/batch1.sh
最佳答案
您可以手动运行脚本吗?
您是否尝试在命令前面添加sudo
?
你在 root 下运行 crontab 吗?可能值得尝试。可能是权限有问题。
关于linux - crontab 用于调度 shell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22835565/