We have moved to a new Sailfish OS Forum. Please start new discussions there.
5

Which directories to back – and which not?

asked 2015-03-09 10:20:56 +0200

nomeata gravatar image

One great thing about having an open and Linux-based phone is that I can treat it like all my other Linux based machines when it comes to backups. In my case, my home server does nightly incremental backups using rsync over SSH.

For this I need to specify which directories it should backup and which not.

Currently, I am excluding:

  • /var/systemlog
  • /var/log
  • /var/cache
  • /run
  • /tmp
  • /dev
  • /sys
  • /proc
  • /home/nemo/android_storage
  • /opt/alien
  • /data/media/osmand/*obf

The first few are standard. I’m not completely sure about android_storage and alien, but I am under the impression that these directories only contain files present elsewhere as well.

Could this list be improved? Am I excluding too much? Is anything missing?

edit retag flag offensive close delete

Comments

/home/nemo/android_storage is the folder where all the Android apps store their data. If you have Android apps it could make sense to backup this folder, but it might be difficult to restore it properly.

wanderer ( 2015-03-09 14:56:50 +0200 )edit

The way you are doing it is at the root of it (alien) that is fine as long as you do not write it while fusermounted - as it does not matter much I exclude /data/media but include $home/android_storage

chemist ( 2015-03-09 15:00:16 +0200 )edit

@wanderer: It seems that /home/nemo/android_storage is also in /data/media, so I exclude the one in /home.

nomeata ( 2015-03-09 15:27:53 +0200 )edit

@nomeata/home/nemo/android_storageis/data/media or /opt/alien/data/media respectively, fusermount

chemist ( 2015-03-09 16:47:55 +0200 )edit

I'm just periodically rsyncing /home/nemo each night... and that's about it.

IMHO there is not really need for backing up anything else. For all the tweaks that I use, for example I keep both the originals and pathches under my home, likewise for all my RPM's.

juiceme ( 2015-03-09 22:58:52 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2015-03-10 01:20:02 +0200

saturn gravatar image

I would like to see more scripts from people doing this to get ideas and optimise/correct mine.

Here is mine:

#!/bin/sh

## Variables
ORIG_HOME=/home/nemo
DEST_HOME=/drives/d/backups_common/Jolla_sync
ORIG_SDHC=/media/sdcard/24BB-8068
DEST_SDHC=/drives/d/backups_common/Jolla_sync_SDHC
LOG=/drives/d/backups_common/rsync-log-czamJolla-backup
IP=192.168.0.14

## Execute rsyncs
START=`date '+%Y%m%d-%H%M%S'`
rsync -artvuzh --progress --delete --log-file=$LOG/rsync-log-czamJolla-$START.txt --exclude-from 'rsync-exclude-list.txt' -e ssh nemo@$IP:$ORIG_HOME/ $DEST_HOME/
START=`date '+%Y%m%d-%H%M%S'`
rsync -artvuzh --progress --delete --log-file=$LOG/rsync-log-czamJolla-$START.txt --exclude-from 'rsync-exclude-list.txt' -e ssh nemo@$IP:$ORIG_SDHC/ $DEST_SDHC/

and the contents of rsync-exclude-list.txt is:

.local/share/system/privileged
.cache/msyncd
.config/signond
.local/share/harbour-seriesme
android_storage/Android/data/me.onemobile.android
android_storage/Android/data/com.here.app.maps
android_storage/Android/data/com.google.android.apps.translate
android_storage/.aptoide
.mozilla
.cache/gagbook
.cache/GagBook
.mozilla/mozembed/lock
.Music

Basically the first three entries I exclude them because they belong to root and i execute the script with user rights. I didn't spend time to find out how to overcome it.

Thanks for any comments

edit flag offensive delete publish link more

Comments

But isn’t .local/share/system/privileged full of important data, like the calendar and the address book?

nomeata ( 2015-03-10 10:09:28 +0200 )edit
Login/Signup to Answer

Question tools

Follow
8 followers

Stats

Asked: 2015-03-09 10:20:56 +0200

Seen: 383 times

Last updated: Mar 10 '15