Crontab automatic execution

Source: Internet
Author: User
Crontab automatic execution-Linux general technology-Linux programming and kernel information. The following is a detailed description. When the local machine executes the source code manually, the files generated by the local machine contain content.
But when it is automatically executed in crontab, the file content generated by the local machine is empty.
Please kindly advise! Thank you!

Source code:
[Testfos @ ctb251 ~] $ Cd zhang/
[Testfos @ ctbw.zhang] $ ls
Ctb25da-e ctb25366f ctb25366o df. sh
[Testfos @ ctbw.zhang] $ more df. sh
#! /Bin/sh
Var = ctb25366f
Var = ctb251_E
VAR = ctb251_O
Find/home/testfos/logs-mtime-1-name "W * ctb *. log "| xargs ls-tl | awk '{print $8}' | xargs grep" initial rate "| awk 'BEGIN {CT =" "} {if ($1! = CT) {print substr ($1, 20, length (
$1)-41), substr ($1, length ($1)-9, 10), $6; CT = $1 }}'>/home/testfos/zhang/$ var
Find/home/testfos/logs-mtime-1-name "W * ctb *. log "| xargs ls-tl | awk '{print $8}' | xargs grep" initial yield pass "| awk 'begin {CT =" "} {if ($1! = CT) {print substr ($, 20, l
Ength ($1)-41), substr ($1, length ($1)-9, 10), $7; CT = $1 }}'>/home/testfos/zhang/$ Var
Find/home/testfos/logs-mtime-1-name "W * ctb *. log "| xargs ls-tl | awk '{print $8}' | xargs grep" DRV Power "| awk 'BEGIN {CT =" "} {if ($1! = CT) {split ($0, con, "M]"); print subs
Tr ($1,20, length ($1)-41), substr ($1, length ($1)-9, 10), con [2]; CT! = $1 }}'>/home/testfos/zhang/$ VAR
Ftp-n < Open 172.27.124.123
User op
Cd/var/janet/dut/TDBI/YIDLE/DF_Fir
LCD/home/testfos/zhang
Bin
Put $ var
Cd/var/janet/dut/TDBI/YIDLE/DF_End
LCD/home/testfos/zhang
Bin
Put $ Var
Cd/var/janet/dut/TDBI/YIDLE/DF_Oc
LCD/home/testfos/zhang
Bin
Put $ VAR
Bye

---------------------
The crontab content is as follows:
[Testfos @ ctb1_zhang] $ crontab-l
50 20 ***/home/testfos/zhang/df. sh>/tmp/test. log 2> & 1


Please kindly advise! Thank you.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.