Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac自动化脚本 #303

Open
itgoyo opened this issue Nov 3, 2022 · 2 comments
Open

Mac自动化脚本 #303

itgoyo opened this issue Nov 3, 2022 · 2 comments

Comments

@itgoyo
Copy link
Owner

itgoyo commented Nov 3, 2022

crontab 每分钟定时执行:

*/1 * * * * service mysqld restart // 每隔 1 分钟执行一次
*/10 * * * * service mysqld restart // 每隔 10 分钟执行一次

crontab 每小时定时执行:

0 */1 * * * service mysqld restart // 每 1 小时执行一次
0 */2 * * * service mysqld restart // 每 2 小时执行一次

crontab 每天定时执行:

0 10 * * * service mysqld restart // 每天 10 点执行
30 19 * * * service mysqld restart // 每天 19 点 30 分执行

crontab 每周定时执行:

0 10 * * 1 service mysqld restart // 每周一 10 点执行
30 17 * * 5 service mysqld restart // 每周五 17 点 30 分执行

crontab 每年定时执行:

0 10 1 10 * service mysqld restart // 每年的 10 月 1 日 10 点执行
0 20 8 8 * service mysqld restart // 每年的 8 月 8 日 20 点执行

crontab 每天 5:00 和 17:00 执行任务

0 5,17 * * * /scripts/script.sh

@itgoyo
Copy link
Owner Author

itgoyo commented Nov 3, 2022

创建脚本crontab -e

查看当前运行的脚本crontab -l

脚本内容

55 17 * * * bash /Users/itgoyo/Downloads/copy.sh

@itgoyo
Copy link
Owner Author

itgoyo commented Nov 3, 2022

#!/bin/bash
cp /Users/itgoyo/Movies/Omi\ Screen\ Recorder/* /Volumes/biliup/Record

@itgoyo itgoyo changed the title Mac自动话脚本 Mac自动化脚本 Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant