Mobile version of this pagePixoh.com and Instant Domain Search
Next:
isInt() JavaScript function
Related blogs
Crontab wizardHow to uninstall nginx with apt
Redirect stderr into becoming dots in Bash
Amazon bug in shopping basket
One thing I hate about Linux: cron
Related by category
SVN + ./todo + crontab
svn, /todo, crontab, todolist, jan, todo
19th of May 2006
I've now started playing with ./todo which is a really promising method (for me) for maintaining a simple todolist. When at work I more or less live on the command line and can do things there much faster than I can with an online todolist or a proper GUI. Now I simply write:
and it adds "Call Jan about svn repo" to my todo list. To view the todo list I simply write:
Every item in the list has a number which you can use to mark things done or change priority.
Anywho, now I've put my little todo.txt in my personal SVN repository on one of our servers. But, how do I make sure that my changes to the todo list are always backed up with SVN (subversion)? I could hack the ./todo script to do a svn commit on every change and svn update every time I do a ./todo list but that would be far too slow.
So, I created a little shell script with some help from my colleague Jan. It's meant to be run every 10 minutes and it will only work if there's a network connection. If there's a conflict, a message is sent to all open terminals with the program wall. Long story short, here's the code:
[ -f ~/WORK/TODO/todo.txt.mine ] && {
[ ! -f /tmp/SVN_conflict_warning_sent ] && {
echo "SVN conflict with ~/WORK/TODO/todo.txt" | wall;
touch /tmp/SVN_conflict_warning_sent;
exit 1; }
}
ping -c 1 svn.fry-it.com > /dev/null 2>&1
[ $? -eq 0 ] && {
svn update ~/WORK/TODO > /dev/null 2>&1;
svn commit ~/WORK/TODO > /dev/null 2>&1;
}
[ -f /tmp/SVN_conflict_warning_sent ] && {
rm /tmp/SVN_conflict_warning_sent;
}
I've only just started this and I might have made some errors. I tried it around a bit before sticking it inside a cron job and it seems to work.
I'll write more later about if todo works for me. You never know, I might get bored and go back to pen and paper again.







Save this page in del.icio.us