Hack-A-N900/Rsnapshot

aus Metalab, dem offenen Zentrum für meta-disziplinäre Magier und technisch-kreative Enthusiasten.
Wechseln zu: Navigation, Suche

Before tinkering with your N900 you should always create a backup. anyway, currently there is no full backup solution provided for maemo fremantle. But hey, it's a linux box. ;)

I'm using rsnapshot to create regular as well as manual backups of my N900 root fs. Using rsnapshot, it is possible to take snapshots of your filesystems at different points in time. Using hard links, rsnapshot creates the illusion of multiple full backups, while only taking up the space of one full backup plus differences. When coupled with ssh, it is possible to take snapshots of remote filesystems as well.

Make sure to read the manual of rsnapshot.


Prerequisites

Install rsnapshot on your PC

Install rsync on your N900

apt-get install rsync

Edit /etc/rsnapshot.conf on your PC

Entries i changed:

snapshot_root	/.snapshots/
cmd_cp		/bin/cp
cmd_rm		/bin/rm
cmd_rsync	/usr/bin/rsync
cmd_ssh	/usr/bin/ssh
cmd_du	/usr/bin/du
cmd_rsnapshot_diff	/usr/bin/rsnapshot-diff

#########################################
#           BACKUP INTERVALS            #
# Must be unique and in ascending order #
# i.e. hourly, daily, weekly, etc.      #
#########################################

# target for manual backups - rotate 50 snapshots
interval	manual	50

# targets for regular backups
interval	hourly	6
interval	daily	7
interval	weekly	4

# ssh private key for my n900
ssh_args	-i /home/elchaschab/.ssh/id_rsa_n900

du_args	-csh

# backup only root partition. no special fs. one_fs=1 prevents spanning across file systems
backup	root@minime:/boot	minime/
backup	root@minime:/cdrom	minime/
backup	root@minime:/etc	minime/
backup	root@minime:/home	minime/	one_fs=1
backup	root@minime:/initrd	minime/
backup	root@minime:/lib	minime/
backup	root@minime:/root	minime/
backup	root@minime:/sbin	minime/
backup	root@minime:/srv	minime/
backup	root@minime:/syspart	minime/
backup	root@minime:/usr	minime/
backup	root@minime:/var	minime/	one_fs=1

Configure automatic backup

I added following to my /etc/crontab:

0 */4 * * *         /usr/local/bin/rsnapshot hourly
50 23 * * *         /usr/local/bin/rsnapshot daily
40 23 * * 6         /usr/local/bin/rsnapshot weekly

6 hourly backups a day (once every 4 hours, at 0,4,8,12,16,20)
1 daily backup every day, at 11:50PM
1 weekly backup every week, at 11:40PM, on Saturdays (6th day of week)

Usage

Trigger manual backup on your PC:

sudo rsnapshot -v manual

Diff two snapshots

sudo rsnapshot -v diff manual.0 manual.2