View Single Post
Posts: 968 | Thanked: 974 times | Joined on Nov 2008 @ Ohio
#1
Just ran into an interesting problem this morning. Rebooted my N900 and plugged the charger in once it hit the Nokia screen.

For some reason when it had finished booting, my contacts/calendar were gone, widgets were all reset to defaults, some weren't showing.

It appears that all or part of my /home/user directory disappeared. Widget settings were gone, etc. All my applications were still installed, but all the settings stored in /user/ were gone.

In particular, the comics widget got reset, pretty annoying to start over reading comics from january (particularly since the comics are in the MyDocs folder. Fortunately, I had a backup from about 2 weeks ago, so I only had to go through the last 2 weeks of comics.

I also had to redo settings for many other programs (ermining, alarmed, etc). Email was ok.

Anyway, I wrote a quick script to backup /home/user (excluding MyDocs), that I can schedule to run through alarmed (or any other scheduling app). It checks to make sure the N900 is charging before running. Just thought I'd post it here for anyone else interested.

I'm sure there are better ways to do this, feel free to modify all you want.

Code:
#! /bin/sh

ischarging=`hal-device bme | grep is_charging | awk '{print $3}'`
if [ $ischarging = "true" ]; then
	tar -cvf /home/user/MyDocs/tmp/user.tar /home/user --exclude "MyDocs"
#	tar -cvf /home/user/MyDocs/tmp/opt.tar /opt
fi
*EDIT* it also has a line to backup /opt as well (obviously)
__________________
*Consumer*, not a developer! I apologize for any inconvenience.
My script to backup /home and /opt
Samsung Galaxy S Vibrant, Huawei S7, N900(retired), N800(retired)
 

The Following 5 Users Say Thank You to lemmyslender For This Useful Post: