有时候需要linux进行一些后台定时任务,可以用crontab来完成
$crontab -e
```
# m h dom mom dow command
SHELL = /bin/bash
*/1 * * * * cd /root/ && ./autopush.sh;
* 1 * * * /usr/bin/wget -q -O temp.txt https://47.88.190.170/tool/crontab.php? service=RunEveryDay.UpdateStoreRank;
```
shell写法示例
```
#!/bin/sh
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
/usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/csft.conf --all --rotate
/usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/csft.conf --stop
sleep 1;
echo y|rm /usr/local/coreseek/var/log/searchd.log
sleep 1;
/usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/csft.conf
```