crontab自动签到,随机签到时间
用shell脚本和php脚本就可以做到自动签到,为了避免签到时间完全一样被后台识别,签到的时间随机在一个范围内
[www@host autosign]$ cat randomSignTime.sh autosign.sh
#!/bin/bash
randomSignTime=$(( ( RANDOM % 20 ) + 1 ))
crontab -r
(crontab -l ; echo "50 23 * * * /home/www/yiciyuan/randomSignTime.sh > /dev/null 2>&1" ) | crontab -
(crontab -l ; echo "${randomSignTime} 0 * * * /home/www/yiciyuan/autosign.sh > /dev/null 2>&1" ) | crontab -
#!/bin/sh
log=/home/www/yiciyuan/sign.log
echo "------->"`date` >> ${log}
/bin/php /home/www/yiciyuan/autosign.php >> ${log} 2>&1
# generated crontab
50 23 * * * /home/www/yiciyuan/randomSignTime.sh > /dev/null 2>&1
4 0 * * * /home/www/yiciyuan/autosign.sh > /dev/null 2>&1