Linux Timing Task Detailed---matlab background run

Source: Internet
Author: User

1. Create a. sh file (such as timetask.sh) to define the commands that need to be executed on a timed basis

e.g

#!/bin/sh
Cd/usr/local/drivebehavior/aliyunserver
Nohup/usr/local/matlab/r2013b/bin/matlab <main.m 1>running.log 2>running.err &

Where the first line of #!/bin/sh is the required execution command for the script, the second behavior requires the specified run directory, and the third behavior Target command, which is the task that needs to be performed.

2. Type crontab-e edit crontab service file

e.g

XX 3 * * */bin/sh/usr/local/drivebehavior/aliyunserver/timetask.sh

Where,/bin/sh is the execution of the command, the time is 3 o'clock in the morning per day

Save the file and exit

3. To see if the Crontab service under this user is created successfully, use the CRONTAB-L command

4, use the command sudo service cron Restart restart the scheduled task!

So, the whole process is done.

Reference Links: http://www.blogjava.net/freeman1984/archive/2010/09/23/332715.html

Linux Timing Task Detailed---matlab background run

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.