Guest User

Untitled

a guest
Feb 25th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #!/bin/bash
  2. # This hooks script syncs task warrior to the configured task server.
  3. # The on-exit event is triggered once, after all processing is complete.
  4.  
  5. # Make sure hooks are enabled
  6.  
  7. LOCK_FILE=~/.task/autosync.lock
  8.  
  9. if [ ! -f $LOCK_FILE ]; then
  10. touch $LOCK_FILE
  11.  
  12. # Only sync, if the backlog is not empty
  13. if ((`cat ~/.task/backlog.data | wc -l` > 1)); then
  14. task sync >> ~/.task/sync_hook.log
  15. fi
  16.  
  17. rm $LOCK_FILE
  18. fi
  19.  
  20. exit 0
Add Comment
Please, Sign In to add comment