Code Monkey home page Code Monkey logo

kde-plasma-backup's Introduction

kde-plasma-backup

This script was made to have a simple way to backup and restore KDE Plasma Desktop environment configuration when moving to other computer.

Syntax

The usage of the script is simple: it only needs to get the action that must execute, with some mandatory or optional options:

kde-plasma-backup.sh action [options]

Actions

The actions that supports for the moment are the next ones:

  • backup: The backup is made in a compressed .tgz file including all the user specific configuration files from home directory. The default output directory of the backup is /tmp but you can change it with -o option. The script also can upload the backup file to a Dropbox account.
  • restore: Once one backup is made, we can restore it with this action. The -f option is required to specify the input backup from which we want to restore the KDE Plasma configuration made in the previous action.
  • help: Print the help message with all actions and options.

Options

backup

-o <directory>   #  output directory where it will be created the backup file. Default value is /tmp
-d               #  uploads the backup file generated to the Dropbox account configured

restore

-f <file>        #  file to use for restoring KDE configuration environment

Requirements

Restore process

The restore must be executed from SSH or TTY directly, without any open user session, because when the system runs the logout process, some of the actual configuration of plasmashell and KDE is writed to disk, overwritting the settings that were been applied with the restore.

Upload backup file to Dropbox account

The upload of the backup file to the Dropbox account needs a valid access token from an user or app access privileges. The token needs to be configured in the dropbox.properties file replacing the value of DROPBOX_TOKEN variable with the value of the valid access token. This variable can also be configured in our shell environment (like .zshrc or .bashrc files for example), to have always our dropbox access token configured separated from the script directory.

Examples

kde-plasma-backup.sh backup
kde-plasma-backup.sh backup -o /tmp/tmp
kde-plasma-backup.sh backup -d
kde-plasma-backup.sh restore -f /path/to/file

kde-plasma-backup's People

Contributors

rubenaleman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

kde-plasma-backup's Issues

To list files that you want to skip

Hi Ruben,

First of all, Thank you very much for the script.
So many write about it, but you created an easy solution. Brilliant.

As I have adjusted also the file: user-places.xbel (dolphin), I looked into the code why this has not been copied and found this section.
In the script:
SHARE_FILES=
CONFIG_FILES=

SHARE_FILES=("color-schemes" "knewstuff3" "konsole" "kxmlgui5" "plasma" "aurorae" "themes")
CONFIG_FILES=("dolphinrc" "plasma*" "powerdevilrc" "powermanagementprofilesrc" "startupconfig" "startupconfigkeys" "systemsettingsrc" "touchpadrc" "gtk-2.0" "gtk-3.0" "gtk-4.0")


These two lines look to me like a small workaround:
rsync -aqR ${HOME}/./.config/k* $BACKUP_DIR
rsync -aqR ${HOME}/./.gtkrc-2.0 $BACKUP_DIR

The backup section:

echo "[*] Doing backup of KDE environment configuration files."
for file in ${SHARE_FILES[*]}; do
rsync -aqR ${HOME}/./.local/share/${file} $BACKUP_DIR
done
for file in ${CONFIG_FILES[*]}; do
rsync -aqR ${HOME}/./.config/${file} $BACKUP_DIR
done
rsync -aqR ${HOME}/./.config/k* $BACKUP_DIR
rsync -aqR ${HOME}/./.gtkrc-2.0 $BACKUP_DIR
tar czf ${OUTPUT_DIR}/${BACKUP_NAME} -C $BACKUP_DIR .
rm -rf $BACKUP_DIR
echo "[*] KDE environment backup file generated in ${OUTPUT_DIR}"


That said, I thought why not writing a another script where you use
SHARE_FILES=
CONFIG_FILES=
to list files that you want to skip, like *.bak *.old , but everything else gets copied?

What were your intention to do it the way you did?

Br,
Tido

Plasma 5

Could you add support to plasma 5?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.