简体   繁体   English

Bash脚本Cron Job

[英]Bash Script Cron Job

I have installed PCoIP Teradici PCoIP Solutions for linux in Centos 6.4. 我已经在Centos 6.4中为Linux安装了PCoIP Teradici PCoIP解决方案。 I want to get macAdress of HostCard, when i run pcoip_agent -info it gives correct output using command line. 我想获取HostCard的macAdress,当我运行pcoip_agent -info ,使用命令行给出正确的输出。 I want make this cron job, for that purpose i write bash script 我想做这个Cron工作,为此我编写bash脚本

#!/bin/bash
hostcardMacAddress=$(pcoip_agent --info|grep  -F 'PCoIP Host card MAC:'|awk '{print $5}' > hostcardMacAddress.txt)
cat hostcardMacAddress.txt

after that i make this script a cron job but it gives empty macAddress. 之后,我将此脚本设为cron作业,但它给出了空的macAddress。

Kindly help me. 请帮助我。 Thanks. 谢谢。

Check the mail of the user that owns the cron job. 检查拥有cron作业的用户的邮件。 There will be an error message indicating what the issue is. 将会出现一条错误消息,指出问题所在。

Login as cron-job's user enter mail and check for mail at the time the cron job was invoked. 以cron-job的用户身份登录,输入mail并在调用cron作业时检查邮件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM