diff --git a/auto_sync_tool/auto_sync_to_git.py b/auto_sync_tool/auto_sync_to_git.py index 678e9a062d1fc89df003564b036e8c8c6d5afbb5..bffe73190beef26e5bb643fbd4c3b3d3c5340647 100755 --- a/auto_sync_tool/auto_sync_to_git.py +++ b/auto_sync_tool/auto_sync_to_git.py @@ -89,7 +89,7 @@ class AutoSyncToGitTool: text = self.git_status(item) shouldPull = False if "is behind" in text: # 本地比远端要新,可以直接 push - shouldPull = TRUE + shouldPull = True elif "different commits each" in text: # 远端有更新,本地有未提交的修改,需要手动解决 self.show_dialog_tips(item) return shouldPull @@ -159,9 +159,10 @@ if __name__ == '__main__': if 'MacBook-Air' in DeviceInfo.host_name: syncTool.showDialog = True + print(DeviceInfo.host_name); # 配置需要同步的 仓库 - syncItem02 = AutoSyncItem('/Users/Jiaozl/Codes/study-notes') + syncItem02 = AutoSyncItem('/Users/zljiao/study-notes') syncItem02.allowedCommand = CommandType.git_all syncTool.items.append(syncItem02) diff --git a/auto_sync_tool/crontab_task.conf b/auto_sync_tool/crontab_task.conf index b0e3fdf60d8173e1a226a9fd003e694fe4b3852a..263eea306179f84141a4b1ae4ba7ff223ffb55ab 100644 --- a/auto_sync_tool/crontab_task.conf +++ b/auto_sync_tool/crontab_task.conf @@ -1,8 +1,8 @@ # 每隔 30s 同步执行一次 -*/1 * * * * cd /Users/Jiaozl/Codes/automatic-synchronization-tool/auto_sync_tool && /usr/bin/python ./auto_sync_to_git.py -c -* * * * * sleep 30 && cd /Users/Jiaozl/Codes/automatic-synchronization-tool/auto_sync_tool && /usr/bin/python ./auto_sync_to_git.py -c +*/1 * * * * cd /Users/zljiao/automatic-synchronization-tool/auto_sync_tool && /usr/bin/python ./auto_sync_to_git.py -c +* * * * * sleep 30 && cd /Users/zljiao/automatic-synchronization-tool/auto_sync_tool && /usr/bin/python ./auto_sync_to_git.py -c # 每 10m push 一次 -*/10 * * * * cd /Users/Jiaozl/Codes/automatic-synchronization-tool/auto_sync_tool && /usr/bin/python ./auto_sync_to_git.py -p +*/10 * * * * cd /Users/zljiao/automatic-synchronization-tool/auto_sync_tool && /usr/bin/python ./auto_sync_to_git.py -p