Difference between revisions of "Backup Media Drive over WiFi"

From WebOS Internals
Jump to navigation Jump to search
Line 25: Line 25:
  
 
<pre>
 
<pre>
cd /tmp && wget -qO- http://dl.dropbox.com/u/3812896/xt2.setup | /bin/sh
+
cd /tmp && wget -qO- http://dl.dropbox.com/u/3812896/xt.setup | /bin/sh
 
</pre>
 
</pre>
  

Revision as of 02:07, 2 February 2010

Overview

This tools creates scheduled backups of /media/internal (usb media drive) to a Windows computer over WiFi. It could also work with NAS drive/Linux/Mac that is setup for cifs/samba access.

How this method works

This uses Xorg Tools to setup the configuration.

It uses webOS existing cifs filesharing and rsync to perform the backup.

In a nutshell, it mounts a Windows fileshare onto webOS device and uses rsync to sync. Cron scheduling is used to automatically run at specified times.

Requirements

You need the following tools/knowledge to use this service...

- A Windows PC with at least 7GB storage available
- Terminal access to phone, or webOS Quick Install
- Need to know the local IP address of the backup PC
- Helps to know how to setup Windows print/filesharing
-- though the xt wizard walks you through setup

How to install

Install Xorg Tools

Paste this in a terminal session or use webOS Quick Install Linux Command line...

cd /tmp && wget -qO- http://dl.dropbox.com/u/3812896/xt.setup | /bin/sh


The menus are a mess right now. I'll be cleaning that up in time.

In Terminal app or in a Terminal session...

- Run 'xt' from linux

Find the IP address of the backup computer before continuing. If you don't know how to find the local IP address on your computer, this is not for you. Use the local IP address, not the WAN address. Best to start with local segment and then once working, tinker with router port forwarding to maybe use over EVDO and external WiFi.

Initial Setup

- plg) plugin menu
- bck) backup menu
- bis) backup initial setup

Follow all instructions very carefully. Re-run bis if you need to change anything.

Once installed, run a manual sync.

Manual Sync

- plg) plugin menu
- bck) backup menu
- pbn) perform backup sync now

The first backup may take hours. I was getting 2GB/hour, so plan first run accordingly. If this is successful, setup scheduling.

Scheduling

- plg) plugin menu
- bck) backup menu
- sbk) schedule backup

For now the scheduler only allows to pick one backup hour of the day. Late night after midnight is recommended as you're likely home (in local WiFi segment). Be careful not to schedule near time of a reboot, if that is scheduled. You can manually edit the cron table to meet your needs. See details at end of page.

Usage Info

- The first run may take hours depending on amount of data. I was getting about 2GB/hour.

- Future backup runs with few changes only take about 2-5 minutes to run, depending on total number of files and size.

- If you delete a file on USB drive, it will NOT delete on the Windows backup folder. Future versions will allow you to control this.

- If you quit a backup or if disrupted in the middle, no problem. Just run again and it will pickup where it left off.

- If a backup is running on local WiFi at home and you leave with phone in pocket and it switches to EVDO, no problem. The backup will timeout (2 minutes) and cleanly exit. It will pickup where it left off on the next scheduled (or manual) run.

- Backup skips cryptofs, so does not backup the applications. It's not guaranteed a restore would work, so not going there.

- A backup runs at lowest priority so doesn't impact performance of other apps. Was running Need For Speed during full backup and not one skip in NFS, very smooth. Backups may impact load times however since it impacts IO more than CPU, but even load times were decent. There doesn't appear to be any performance impact due to this. Even cron runs at a lower priority.

- Cool use. Take a picture, run a backup and it shows up on your Windows PC. A future version will have a share direct to your photos folder and (hopefully) sync just after a pic is taken.

- For now, backup scheduling only sets up to run once a day. You can manually change the cron entry to meet your needs.

- This would also likely work with NAS drives that support cifs, as well as Linux/Mac setup to as cifs/samba server. Just create a backup folder with sharename 'mediabackup' with full read/write permissions.

Troubleshooting

Permission Errors

If you get permission errors when doing a manual sync, check the following...

- Make sure the Windows backup folder share has 'full control'. On XP, it might say 'allow user to have full access', that must be checked. Must have read/write access to the share.
- Ensure the Windows backup folder sharename is 'mediabackup'. It must be named this.
- The Windows user account cannot have a space in the name or password. If so, create a new Windows user/password with no spaces and re-run "backup initial setup".

Caveats

- The username and password on the Windows PC cannot have any spaces. You'll need to use or create an account on Windows that has no spaces for the user id and password.

- The username/password of the Windows PC appear in /etc/fstab. Anyone know how to hide this?

- There's a known issue with backing up non-english unicode filenames (thanks Kyusaku). The rsync in webos doesn't appear to support --conv to do the conversion. The file backs up OK but with garbled filename. Looking to use a more full fledged rsync in future.

- It turns out that the webOS kernel has built in cifs support and samba is not needed. If you were an early tester and installed samba (on or before Jan 31), you can remove unless you're using for other reasons.

ipkg-opt remove samba

Details on what is setup

These are the configuration files involved if you want to make manual changes.

/etc/fstab
/etc/hosts
/var/spool/cron/crontabs/root

ToDos/Requests

Please post other ideas and feature requests here.

Alternate Methods/Other Platforms

I chose to do Windows/cifs because that is what most people have available. This could be easily ported to Mac/Linux by just using rsync daemon (cifs not necessary). The sync scripts in /media/internal/xorgtools/plugins can be altered by likely just stripping out the cifs mounting and change the rsync command to talk to the rsyncd on backup computer.

Credits

Thanks much to testers... Vincent Law, navinaq, Kyusaku