Difference between revisions of "Backup Media Drive over WiFi"

From WebOS Internals
Jump to navigation Jump to search
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
This allows backup of /media/internal to a Windows computer over WiFi using cifs.
+
This tools creates scheduled backups of /media/internal (usb media drive) to a Windows computer over WiFi.
  
 
== How this method works ==
 
== How this method works ==
Line 13: Line 13:
  
 
- A Windows PC with at least 7GB storage available<br>
 
- A Windows PC with at least 7GB storage available<br>
- Need to know the local IP address of the PC to store backups<br>
+
- Need to know the local IP address of the backup PC<br>
 
- Helps to know how to setup Windows print/filesharing<br>
 
- Helps to know how to setup Windows print/filesharing<br>
 
-- though the xt wizard walks you through setup
 
-- though the xt wizard walks you through setup
Line 64: Line 64:
 
- The first run may take hours depending on amount of data.  I was getting about 2GB/hour.
 
- The first run may take hours depending on amount of data.  I was getting about 2GB/hour.
  
- The following backup runs with few changes only take about 2-10 minutes to run.
+
- Future backup runs with few changes only take about 2-10 minutes to run, depending on total number of files and size.
  
 
- 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 you quit a backup or if disrupted in the middle, no problem.  Just run again and it will pickup where it left off.
  
- Backup skips the cryptofs, so does not backup the applications. It's not guaranteed a restore would work, so not going there.
+
- Backup skips cryptofs, so does not backup the applications. It's not guaranteed a restore would work, so not going there.
  
- Backups run 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.
+
- Backups run 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.
  
- Cool use.  Take a picture, run a backup and it shows up on your Windows PC.
+
- 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 sync soon after a pic is taken.
  
- For now, backup scheduling only sets up to run once a day.  You can manually change the cron entry for more auto backups.
+
- 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.  Just create a backup folder with sharename 'mediabackup'.
  
 
== Troubleshooting ==
 
== Troubleshooting ==
Line 82: Line 84:
 
If you get permission errors when doing a manual sync, check the following...
 
If you get permission errors when doing a manual sync, check the following...
  
- Make sure the Windows share has 'full control'.  Must have read/write access to the share.<br>
+
- Make sure the Windows backup folder share has 'full control'.  Must have read/write access to the share.<br>
 
- Ensure the Windows backup folder sharename is 'mediabackup'.  It must be named this.<br>
 
- Ensure the Windows backup folder sharename is 'mediabackup'.  It must be named this.<br>
- The Windows user account cannot have a space in the name or password.  If so, create a new Windows user with no space/password.  Re-run backup initial setup.
+
- The Windows user account cannot have a space in the name or password.  If so, create a new Windows user with no space/password and re-run backup initial setup.
  
 
== Caveats ==
 
== Caveats ==
Line 99: Line 101:
 
These are the configuration files involved if you want to make manual changes.
 
These are the configuration files involved if you want to make manual changes.
  
Edited:<br>
 
 
/etc/fstab<br>
 
/etc/fstab<br>
 
/etc/hosts<br>
 
/etc/hosts<br>
 
/var/spool/cron/crontabs/root
 
/var/spool/cron/crontabs/root
 
  
 
== ToDos/Requests ==
 
== ToDos/Requests ==
 
  
 
Please post other ideas and feature requests here.
 
Please post other ideas and feature requests here.
Line 112: Line 111:
 
== Alternate Methods/Other Platforms ==
 
== Alternate Methods/Other Platforms ==
  
I chose to do Windows/cifs because that is what most people have available.  This could be more easily ported to Mac/Linux by just using rsync (cifs not necessary).
+
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 ==
 
== Credits ==
  
 
Thanks much to testers... Vincent Law, navinaq, Kyusaku
 
Thanks much to testers... Vincent Law, navinaq, Kyusaku

Revision as of 20:25, 1 February 2010

Overview

This tools creates scheduled backups of /media/internal (usb media drive) to a Windows computer over WiFi.

How this method works

This uses Xorg Tools to setup the configuration.

It uses 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
- 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/xt2.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.

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

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-10 minutes to run, depending on total number of files and size.

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

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

- Backups run 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.

- 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 sync soon 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. Just create a backup folder with sharename 'mediabackup'.

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'. 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 with no space/password 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?

- It turns out that 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