HomePosts

cron で 1 時間ごとに自動で git push する

2023-05-13

現在の設定を確認

crontab -l

現在の設定を削除

crontab -r

現在の設定を編集

crontab -e

1 時間ごとに自動で git push する

0 * * * * export LANG=ja_JP.UTF-8 && git add -A && git diff --staged --quiet || (git commit -m "$(date +"%Y-%m-%d %H:%M:%S")" && git push) >/dev/null 2>&1

参考

© 2022 Tsubasa Nakagawa. All rights reserved