Data Warehousing 005 - Review Linux shell command - crontab scheduling sh script to perform a soft background connection

A, crontab scheduling  

  For linux crontab own terms, xxx.sh of ! Generally written in the format beginning with # / bin / bash interpreter , can be added in the script:

date

  However, shell scripts execute permissions need x, the modalities of implementation as follows:

  ./xxx.sh
  sh ./xxx.sh

  Among them, the suffix .sh first line #! / Bin / bash is no need to use the command to execute sh

 

1, crontab simple scheduling

[root@localhost ~]# crontab -e
no crontab for root - using an empty one
* * * * * /root/test.sh >> /root/test.log



#执行
[root@localhost ~]# crontab -l
* * * * * /root/test.sh >> /root/test.log
[root@localhost ~]# crontab -l
* * * * * /root/test.sh >> /root/test.log
[root@localhost ~]# 

among them,  

* * * * * Represent the minutes, hours, days, months, weeks,

    * / * 6 / * = 1
    * representing each

face questions: performing once every 10s

[the root @ localhost ~ ] # test1.sh CAT 
# ! / bin / the bash
 for ((I = . 1 ; I <= . 6 ; I ++ ));
 do 

DATE 
SLEEP 10s 

DONE 

Exit 
[the root @ localhost ~ ] # SH test1.sh 
November 22, 2019 Friday, 02 : 53 : 18 CST 
2019 Friday, November 22 Ri 02 : 53 : 28 CST 
2019 Nian Ri Friday, November 22 02 : 53 : 38 CST

 

 

 

2. Background Execution

  & ./test.sh
  nohup ./test.sh & manually start the development and maintenance of test scripts to see the log
  nohup ./test.sh> /root/test.log 2> & 1 & production

 

 

Second, the soft link

[root@localhost ~]# ll
total 4
drwxr-xr-x 2 root root 6 Nov 20 21:33 mysql5.6 
drwxr-xr-x 2 root root 6 Nov 20 21:33 mysql5.7 
drwxr-xr-x 3 root root 44 Nov 17 23:13 ruozedata
-rw-r--r-- 1 root root 846 Nov 17 23:12 ruozedata.zip
[root@localhost ~]#

  ln -s original path target path

 

     CDH upgrade the original documents are missing cursor skips :
  to find the original file folders;
  delete shortcuts folder - "re-do a new version of the high flexible connections

 

 

Guess you like

Origin www.cnblogs.com/Raodi/p/11909455.html