Skip to content

Instantly share code, notes, and snippets.

@noqqe
Created September 25, 2011 11:12
Show Gist options
  • Save noqqe/1240498 to your computer and use it in GitHub Desktop.
Save noqqe/1240498 to your computer and use it in GitHub Desktop.
MyTinyTodo to Taskwarrior Migration
#!/bin/bash
MYSQLUSER="user"
MYSQLPW="pw"
MYSQLDB="mytinytodo"
OIFS=$IFS ;
IFS='
'
for x in $(mysql -u $MYSQLUSER -p$MYSQLPW -e "use $MYSQLDB ; select d_completed, tags_ids, mtt_lists.name as liste, title from mtt_todolist, mtt_lists where mtt_lists.id = mtt_todolist.list_id;" --batch | grep -v ^d_complet); do
set -- $x
IFS=$OIFS
DATE=$(date +%Y%m%d -d @$1)
RESULT=$(echo -n "task log due:$DATE pro:IMPORT-$2" ; shift ; shift ; echo " $*")
$RESULT
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment