- 写sh文件,内容和执行命令行一致
- 给sh文件加权限
- 下载cron,将sh文件放进cron
- 重启cron
/* write an sh
for example you want to execute java file price.class set at /Users/ABC/Desktop/
you should set followings in your sh file
*/
cd /Users/ABC/Desktop
java price
/*
set name of sh as exe.sh
set authority to your sh file
*/
chmod +x exe.sh
/*
down cron from https://www.drupal.org/project/drupal , set it any place
in your terminal, to input:
*/
crontab -e
//then edit the file, put exe.sh into cron
*/1 * * * * /Users/ABC/Desktop/exe.sh
cron restart