OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: LadyBug on January 24, 2005, 11:55:42 am

Title: Backup Hints?
Post by: LadyBug on January 24, 2005, 11:55:42 am
Last Friday I finally took the plunge and switched from Cacko to pdaXrom. So far I have  pretty much transferred everything I needed, although going from SafeDee to portabase was painful.

Anyway, my main concern now is backup. I'm planning to use unison, but I'd like some input on what folders I should be backuping. /home/root, sure, but it contains only a minor part of the actual tweaked system. Then again, I really am not planning to dump the whole /, since a new ROM version would render that pretty much unusable.

Hints, anyone?
Title: Backup Hints?
Post by: pgas on January 24, 2005, 01:19:02 pm
/etc is traditonally where the system-wide configuration files resides.

So this is probably what you want to save.
Title: Backup Hints?
Post by: totaln00b on January 24, 2005, 03:29:32 pm
Hi,

I saw this post and was greatly relieved because I've been looking for something sensible (idiot-proof) for backing up my zaurus (rc5) for ages. Is there a pdaxrom version of unison available? I can only find one for sharp-roms, or will that work?

Thanks

Jo
Title: Backup Hints?
Post by: Laze on January 24, 2005, 04:10:21 pm
Of course a backup of /home/root (if your running as root - like most people are) - would make all settings and gaim settings etc. stored.
Title: Backup Hints?
Post by: rgrep on January 26, 2005, 02:06:47 am
I haven't used unison before but I use rsync-over-ssh as its fast and perfect for one-way backups.  You can download it from my unstable feed (http://beer.geek.nz/software/zaurus/feed/unstable/).

You might want to check out an rsync wrapper like Dirvish (http://www.dirvish.org/) or Becky (http://sourceforge.net/projects/becky).  I will probably use one of those eventually (since they make complete snapshots, using hardlinks, everytime you backup) but for now I backup my whole Zaurus (excluding applications) using a simple rsync wrapper I wrote.

My backup system consists of two shell scripts, two rsync exclude files and an include file.  Every time I want to backup I just type mybackup in a terminal window and any new files are transferred to my Linux desktop PC using rsync over ssh.  I also use an option on rsync to have it store a backup copy of any file that is replaced.

I store any scripts I write in /usr/local/bin and unfortunately since a lot of ipks install files to the /usr/local tree I've had to create a script that creates an exclude file so that rsync will ignore any files installed by an ipk.  I also sometimes modify files in /usr/share/applications and /usr/share/pixmaps so this script also allows me to specifically include these files.

Here is the source for my scripts and exclude/include files:

/usr/local/bin/mybackup
Code: [Select]
#!/bin/sh
#
# Zaurus backup script
#

OPTS="$* --archive --delete --delete-excluded --rsh=ssh --progress --backup --backup-dir=.rsync-backup --include-from=/mnt/card/backups/mybackup.include --exclude-from=/mnt/card/backups/mybackup.exclude --exclude-from=/mnt/card/backups/mybackup.ipkg.exclude"
SRCS="/etc /home /mnt /usr"
DEST="root@my.desktop.pc:/root/backup/zaurus"

echo -n "Updating exclude list... "
if update-mybackup-excludes; then
        echo "done."
        rsync $OPTS $SRCS $DEST
fi

/usr/local/bin/update-mybackup-excludes
Code: [Select]
#!/bin/sh

TARGET=/mnt/card/backups/mybackup.ipkg.exclude

ME="
$(basename $0)"

if [ ! -w "$TARGET" ]; then
        echo "$ME: file not writable: '$TARGET'"
        exit 1
fi

OUTFILE=$(mktemp /tmp/update-mybackup-excludes.$$.tmp.XXXXXXX)
if [ -z "$OUTFILE" ]; then
        echo "$ME: could not create temporary file"
        exit 2
fi
if [ ! -w "$OUTFILE" ]; then
        echo "$ME: file not writable: '$OUTFILE'"
        exit 3
fi

grep -h "/usr/local" /usr/lib/ipkg/info/* | grep /$ | grep -v -e "local/$" -e "bin/$" -e "share/$" -e "share/applications/$" -e "share/pixmaps/$" > "$OUTFILE"

grep -h "/usr/local" /usr/lib/ipkg/info/* | grep -v "/$" | grep -e "bin/[^/]" -e "share/applications/[^/]" -e "share/pixmaps/[^/]" | sed 's/\[/\\\[/' >> "$OUTFILE"

if cmp -s "$OUTFILE" "$TARGET"; then
        rm $OUTFILE
else
        mv "$OUTFILE" "$TARGET"
fi

/mnt/card/backups/mybackup.exclude
Code: [Select]
/mnt/card/backups/*
/mnt/card/Documents/Music/*
/mnt/card/Documents/Video/*
/mnt/card/Documents/Web/sitescooper/txt
/mnt/card/Documents/sync/*
/mnt/cf
/mnt/fat/initrd.bin
/mnt/fat/tools.tar
/mnt/fat/updater.sh
/mnt/ide
/mnt/net
/mnt/user
/usr/*
/usr/lib/*
/usr/lib/ipkg/*
/usr/share/*
/usr/share/pixmaps/*

/mnt/card/backups/mybackup.include
Code: [Select]
/mnt/card/backups/*.tar.gz
/mnt/card/backups/*clude
/usr/etc
/usr/lib
/usr/lib/ipkg
/usr/lib/ipkg/status
/usr/local
/usr/local/share/applications/dopewars.desktop
/usr/local/share/applications/kanatest.desktop
/usr/local/share/applications/leafpad.desktop
/usr/local/share/pixmaps/dopewars-pill.png
/usr/share
/usr/share/pixmaps
/usr/share/pixmaps/dopewars-pill.png
/usr/share/pixmaps/kanatest.png
/usr/share/pixmaps/leafpad.png

This works well for me but YMMV.
Title: Backup Hints?
Post by: totaln00b on January 26, 2005, 06:49:14 am
rgrep,

your solution seems to be linux-linux, is that correct? I liked the idea of unison as it can do windows to linux and vice versa. Can nobody tell me where to get a pdaXrom version from, or whether the qtopia one will work?

Thanks

Jo
Title: Backup Hints?
Post by: totaln00b on January 27, 2005, 09:21:55 am
OK, sorry, thought I'd searched quite thoroughly about this, but no!

So for other people who might not know, the standard unison ipk works just fine with pdaxrom.