• ALGEMENE VOORWAARDEN
  • GENERAL TERMS & CONDITIONS

KUDOS - IT consultant and FOSS supporter

  • home
  • contact
  • services
  • baanboard
  • msx
Home

Amarok backup script

patvdv's picture

patvdv — Fri, 05/06/2009 - 15:54

I am a big fan of the superb music player and organizer AmaroK, one of KDE's flagship programs. AmaroK supports multiple database backends for storing information about the music collection (e.g. mp3 files) and until recently I was using the default SQLite backend. The amarok SQLite database is located in the user's home directory and as such it is pretty important to have a decent backup of the AmaroK database in case a calamity occurs. What follows is the listing for a very simple AmaroK backup script that uses the SQLite backend.Note: you should adjust the variables DUMP_DIR, DUMP_FILE and LOG_FILE variables at the beginning of the script.

#!/bin/bash
#
# This script make as copy of the amaroK SQLite DB
#
DUMP_DIR="/home/patrick/shares/backup/amarok"
DUMP_FILE="$DUMP_DIR/backup_amarokdb_$(date '+%H%M-%d%m%Y').tar"
LOG_FILE="$HOME/logs/backup_amarok_sqlitedb.log"

if [[ ! -d $DUMP_DIR ]]
then
    mkdir -p $DUMP_DIR
fi

mkdir $DUMP_DIR >/dev/null 2>&1
START_TIME=$(date '+%s')

echo "INFO: starting backup of amaroK SQLite DB at $(date '+%X')" | tee -a $LOG_FILE
cd $HOME
tar cvf $DUMP_FILE .kde/share/apps/amarok/*
tar rvf $DUMP_FILE .kde/share/config/amarok*
gzip $DUMP_FILE
echo "INFO: finished backup of amaroK SQLite DB at $(date '+%X')" | tee -a $LOG_FILE

FINISH_TIME=$(date '+%s')
DURATION=$(($FINISH_TIME - $START_TIME))
SIZE=$(ls -s ${DUMP_FILE}.gz | cut -f1 -d" ")
echo "INFO: backup complete (duration: $DURATION seconds / size: $SIZE KB)" | tee -a $LOG_FILE

exit 0
Bookmark/Search this post with:
  • Delicious Delicious
  • Digg Digg
  • StumbleUpon StumbleUpon
  • Propeller Propeller
  • Reddit Reddit
  • Magnoliacom Magnoliacom
  • Google Google
  • Yahoo Yahoo
  • Technorati Technorati
  • Add new comment

Navigation

  • Glossary
  • Recent posts

Search

User login

  • Request new password

Recent comments

  • On the same port
    8 weeks 5 days ago
  • All, with 2 daemons running
    12 weeks 23 hours ago
  • /etc/init.d/sshd
    16 weeks 2 days ago
  • No easy way to do this
    16 weeks 2 days ago
  • external iface is dhcpd addressed
    16 weeks 3 days ago
  • Great
    18 weeks 4 days ago
  • Great!
    21 weeks 4 days ago
  • Thanks!
    23 weeks 2 days ago
  • keyboard-interactive?
    23 weeks 2 days ago
  • no authentication method
    23 weeks 3 days ago

Use Free Software!

Visit the Free Software Directory

Baanboard.com

  • NEW: added forum and moderator for Russian users!
  • Archiving Localized Data
  • Baan IV and ERP LN Tools Consultant
  • Provide application design and development expertise in Baan IVC4.
  • Purchase order - Exctracting prices
more

UNIX.com

  • Equivalent of /etc/rc.local in Solaris 10
  • RAMDISK: EOF while reading compressed data ...Kernel panic - Unable to mount root
  • Python3 bytearray padding
  • iptables rule problem
  • Perl: Extracting a char from a string.
more

  • home
  • contact
  • services
  • baanboard
  • msx