0x05: post daemon json task scheduling, 0x05json

Source: Internet
Author: User

0x05: post daemon json task scheduling, 0x05json

  • Python signature post
# Coding: utf-8import urllib, urllib2url = 'HTTP: // wtf.thinkphp.com/index.php? M = & c = tools & a = scanport 'values = {'000000': '000000', 'sign': 'c6918c2d019e64bb1d2ed1be3ab71581 '} data = urllib. urlencode (values) req = urllib2.Request (url, data) req. add_header ('user-agent', 'fake-client') res = urllib2.urlopen (req ). read () print res Daemon json crontab
  • Scheduled task execution:Crontab usage:

Crontab-e edit execution script
  1. # M h dom mon dow command
  2. */2 * date> ~ /Time. log
The second line is a test. The script is executed every 2 minutes.
Some examples:
  1. * ***** # Execute a task every minute
  2. 0 * # execute a task at every hour, for example
  3. 6, 10*2 ** # The task is executed at and every month.
  4. */3, */5 * # execute a task every 3 minutes or 5 minutes, such as, and.

After saving the crontab, restart cron to apply the scheduled task:Service cron restart
  • Crontab is executed in seconds.
1. edit crontabcrontab-e *****/bin/date>/tmp/date.txt ***** sleep 10; /bin/date>/tmp/date.txt ***** sleep 20;/bin/date>/tmp/date.txt ****** sleep 30; /bin/date>/tmp/date.txt ***** sleep 40;/bin/date>/tmp/date.txt ****** sleep 50; /bin/date>/tmp/date.txt
Select-editor select editor



  • Job Scheduling sched

 


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.