#/bin/sh# requires the HTTP service address serviceurl= "Http://XXX.XXX.XXX.XXX:8080/p2p/loanCheck/dealFlowLoan" #服务名称 through timed calls, For convenient generation of the corresponding log file servicename= "Dealflowloan" #获取当前目录路径filepath =$ (CD "$ (dirname" $ ")"; pwd "#wget产生的临时文件存放目录tmpfile =" $ filepath/$serviceName. tmp #wget command execution details command= ' wget-o ' $tmpfile "$serviceUrl" '; #执行wget命令echo $command # Writes the contents of the temporary file to the log records echo "$ (date" +%y-%m-%d%h:%m:%s ") $ (cat $tmpfile)" >> $filepath/$serviceName. log############# ################################################################### Deployment notes: # 1. Place the file in a directory on the server and set it to executable. (chmod +x./bulkloanflow.sh) # 2. Edit the/etc/crontab file and add a line of code as follows: (file placed in/root/ws directory) #*/1 * * * * root/root/ws/ bulkloanflow.sh# 3. Execute command: Service Crond restart#################################################################### ###########
Call scripts regularly to complete a specific business