Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-03-23 06:15:11

orschiro
Member
Registered: 2017-11-30
Posts: 65

A single shell command to backup the entire Xfce configuration?

Hey guys,

Is there a single shell command to back up my entire Xfce desktop?

Ideally in a zipped archive that I can carry with me or upload to a cloud drive for easy storage and retrieval once I want to replicate my desktop on a new machine. :-)

That would be lovely!

Thank you.

Offline

#2 2019-03-23 12:53:08

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: A single shell command to backup the entire Xfce configuration?

You can use tar to zip up the contents of the folders you want to save and restore on another computer. Something like:

tar czvf Xfce.tar.gz <DIRECTORIES>

...where <DIRECTORIES> is a space-separated list of directories to back up. Have a read through this thread for a list of directories to consider.

The basic process to move to another computer would be:

  1. back up the current config

  2. create a new user account on the new computer

  3. un-compress the tar file in the new user's account

  4. log in as the new user

Note: that if changing account names, any reference to your old account name will need to be manually changed. If changing computers, you may need to consider whether both computers have the same set of applications installed.

As a test, on my current computer I backed up my Xfce settings:

tar czvf xfce.tar.gz bin .config/autostart .config/gtk-2.0 .config/gtk-3.0 .config/menus .config/Mousepad .config/Thunar .config/xfce4 .config/mimeapps.list .local/share/applications .local/share/mime .local/share/Thunar .devilspie .icons .themes

...create a new user account:

sudo useradd -m -s /bin/bash -G wheel newuser && sudo passwd newuser

...then copied over the Xfce.tar.gz file to that account and gave the new user ownership of that file:

sudo cp Xfce.tar.gz /home/newuser && sudo chown newuser /home/newuser/Xfce.tar.gz

...su'd into the new account:

su - newuser

...and umcpressed the file:

tar xzvf Xfce.tar.gz

When I logged in as newuser, the settings and setup was properly applied. (I had some references to my "toz" username in script files that I needed to change).


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2019-03-23 17:08:49

orschiro
Member
Registered: 2017-11-30
Posts: 65

Re: A single shell command to backup the entire Xfce configuration?

Excellent solution. Thanks ToZ! :-)

I have combined this with the following crontab:

0 * * * * su orschiro -c "/home/orschiro/bin/backup.sh"

Last edited by orschiro (2019-03-23 17:09:46)

Offline

Board footer

Powered by FluxBB