0x05: post daemon json task scheduling, 0x05json
# 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
- # M h dom mon dow command
- */2 * date> ~ /Time. log
The second line is a test. The script is executed every 2 minutes.
Some examples:
- * ***** # Execute a task every minute
- 0 * # execute a task at every hour, for example
- 6, 10*2 ** # The task is executed at and every month.
- */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