From bf2b793258fd676c12824a51b2cec627881f6a74 Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 15 Jun 2015 09:43:46 +0200 Subject: [PATCH] Add documentation --- backup_mpd_playlist.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/backup_mpd_playlist.py b/backup_mpd_playlist.py index 65307ca..6827af5 100755 --- a/backup_mpd_playlist.py +++ b/backup_mpd_playlist.py @@ -1,5 +1,17 @@ #!/usr/bin/env python -# Back up the state of MPD (current playlist and so on) +# +# Back up the state of MPD (current playlist and so on); this allows you +# to recover when you accidentally clear your playlist. +# +# This uses the python-mpd2 library from : +# sudo pip3 install python-mpd2 +# +# I run it from cron every 20 minutes or so (as user mpd, but you can +# run it as any user, passing in the backup directory with -d): +# cat /etc/cron.d/mpd_backup +# */20 * * * * mpd [ -x /var/lib/mpd/backup_mpd_playlist.py ] && python /var/lib/mpd/backup_mpd_playlist.py +# +# By Timothy Allen import ast import datetime