• 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

re

Anonymous — Sat, 13/03/2010 - 20:24

To investigate the this good topic used to be not very simple and really good way out is to buy essays at the paper writing service.

  • reply

Navigation

  • Glossary
  • Recent posts

Search

User login

  • Request new password

Recent comments

  • re
    1 day 1 hour ago
  • respond this topic
    2 days 10 hours ago
  • Great!
    1 week 5 days ago
  • Thanks!
    3 weeks 3 days ago
  • keyboard-interactive?
    3 weeks 3 days ago
  • no authentication method
    3 weeks 4 days ago
  • nicely written
    3 weeks 4 days ago
  • Awesome! Thank you!
    10 weeks 3 days ago
  • Excellent script
    10 weeks 3 days ago
  • Not corrupt but wrong file extension
    41 weeks 4 days ago

Use Free Software!

Visit the Free Software Directory

Baanboard.com

  • Baan Finance Support consultant (Mid Level)
  • Baan Logistic Consultant, with 5 year experience in Baan IV, SP0, FP2.
  • Determine the domain of a field (Baan IV)
  • How to get day difference between 2 dates?
  • ntbshell response very slow from command line
more

UNIX.com

  • count words and empty files
  • Help with pattern matching
  • Using grep to extract PID
  • Help with for loops
  • common contents of two files
more

  • home
  • contact
  • services
  • baanboard
  • msx