One of the benefits of using scripts instead of executable programs in Linux timed tasks

Source: Internet
Author: User

Iamlaosong

Because you want to modify the importer, you discover a benefit of using scripts in the Linux timed task instead of executable programs.

Linux server has a scheduled task, the downloaded data into the database, such tasks are usually started early in the morning. Because the data structure changes or optimization procedures, you need to modify the import program, and the import program because of the long execution time, the day is often in execution, can not be overwritten, can only be saved with another name, to the scheduled task the next day when the new program starts, you must modify the program name in the scheduled task.

If a script is used in a timed task and the importer is executed in the script, it is possible to modify the executable name in the script, because the script can be overwritten without affecting the original executed script and avoids the hassle of modifying the scheduled task. script qtimp.sh:

# #ftp get EMS data from Downcenter server 10.3.10.40# #eidt by Iamlaosong 20130205#datdir= ' date-d ' – 1 day ' +%y%m%d ' Cd/hom e/oracle/bin/sdptqt# the code of Provincesfor Pcode in 11 12 13 14 15 21 22 23 31 32 33 35 36 37 41 42 43 44 45 46 50 51 5 2 65dofname=03004_${pcode}_${datdir}.datecho ${fname}./sdpt_qt1 ${datdir} 03004 ${pcode}fname=03005_${p Code}_${datdir}.datecho ${fname}./sdpt_qt1 ${datdir} 03005 ${pcode}done


One of the SDPT_QT1 is the new program, the original is SDPT_QT.

After writing to think of this benefit is how insignificant, just a method, after all, modify the timing task is also very simple.

One of the benefits of using scripts instead of executable programs in Linux timed tasks

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.