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 自动 Commit 保存 Obsidian 历史信息 #78

Open
sedationh opened this issue Apr 4, 2024 · 0 comments
Open

Mac 自动 Commit 保存 Obsidian 历史信息 #78

sedationh opened this issue Apr 4, 2024 · 0 comments

Comments

@sedationh
Copy link
Owner

sedationh commented Apr 4, 2024

#!/bin/zsh
cd {obsidian 目录}
git add -A

# 生成提交信息,包含当前日期和时间

commit_message="commit-work-log: $(date '+%Y-%m-%d %H:%M:%S')"

git commit -m "$commit_message"

shell 输入 crontab -e

0 * * * * {上面脚本的所在目录}


解释各个字段:
0: 表示在每个小时的第0分钟执行。
*: 表示每个小时执行一次。
*: 表示任何一天。
*: 表示任何一个月。
*: 表示任何一周的星期几。

image

@sedationh sedationh changed the title 自动 Commit 保存 Obsidian 历史信息 Mac 自动 Commit 保存 Obsidian 历史信息 Apr 4, 2024
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