Created
February 14, 2018 08:02
-
-
Save marchbnr/6bc4e847da16c53133df16155280699a to your computer and use it in GitHub Desktop.
Automatically sync taskwarrior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This hooks script syncs task warrior to the configured task server. | |
# The on-exit event is triggered once, after all processing is complete. | |
# Make sure hooks are enabled | |
LOCK_FILE=~/.task/autosync.lock | |
if [ ! -f $LOCK_FILE ]; then | |
touch $LOCK_FILE | |
# Only sync, if the backlog is not empty | |
if ((`cat ~/.task/backlog.data | wc -l` > 1)); then | |
task sync >> ~/.task/sync_hook.log | |
fi | |
rm $LOCK_FILE | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's the best way to trigger this? With a cron? Or is there a way to trigger it after running at taskwarrior command?