赞
踩
Mac系统下
sudo /usr/sbin/cron start
sudo /usr/sbin/cron restart
sudo /usr/sbin/cron stop
我们以autoPush.sh为例
进入你脚本文件需要存放的目录
cd /Users/houxin/houxin/公司账号/sh
分别执行以下命令
创建
touch autoPush.sh
修改权限
chmod 755 autoPush.sh
编辑内容
vim autoPush.sh
输入类似于以下的内容
cd /Users/houxin/houxin/公司账号
git add . && git commit -m 'Automatically update and push at %date% %time% by mac'
git pull && git push
crontab -e
内容如下
1 * * * * * /Users/houxin/houxin/公司账号/sh/autoPush.sh
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。