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