<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Peter's Blog - Nodes for backup</title>
    <link>http://www.petersblog.org/</link>
    <description>Nodes containing the tag backup</description>
    <item>
      <title>Disk Full</title>
      <link>http://www.petersblog.org/node/view/1612</link>
      <description>&lt;p&gt;
I set up a cron job to backup my web sites to my &lt;a href="/node/1609"&gt;Mythical Convergence Box&lt;/a&gt;, just a simple rsync of the subversion repository and, to be safe, /var/www. The latter was 500Mbytes. 
&lt;/p&gt;
&lt;p&gt;
Next morning the cron job had run and my server was inaccessable. Oops, with 10g of WoW and 10g of family photos I had filled the main disk up, my 250g Myth disk being mounted on /var/lib/mythtv. The box hadn't crashed but it was in a kind of coma, you ask it to do something and it went urgh. 
&lt;/p&gt;
&lt;p&gt;
I had to reboot into recovery mode and move the photos to the mythtv disk, leaving me 68%. Observations: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
Interesting how hard the system failed when the disk filled up. Have to be careful. 
&lt;/li&gt;
&lt;li&gt;
Linux recovery mode is actually useful! Whenever I've tried the (admittedly pre-vista) Windows recovery modes it has spent a quarter of an hour loading drivers for obscure disk controllers, then I've tried the automated recovery that never works, then I've rebooted, I've waited another quarter hour, then it's given me something with the raw power of a 1985 dos prompt, then I've given up and reformatted the disk. 
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
Last night my cron job worked fine and my websites are so thoroughly backed up that my head is spinning. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/backup"&gt;backup&lt;/a&gt; &lt;a href="/tag/linux"&gt;linux&lt;/a&gt; &lt;a href="/tag/ubuntu"&gt;ubuntu&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1612</guid>
      <category domain="http://www.technorati.com/tag">backup</category>
      <category domain="http://www.technorati.com/tag">linux</category>
      <category domain="http://www.technorati.com/tag">ubuntu</category>
    </item>
    <item>
      <title>Out with Rsync, in with Unison</title>
      <link>http://www.petersblog.org/node/view/1549</link>
      <description>&lt;p&gt;
I had my rsync scripts set up and running. I had backup and get scripts so I could backup my work to a server, go home, download the changes, do some work, upload the changes, download them again at work. Who needs a flash drive? 
&lt;/p&gt;
&lt;p&gt;
However there's this thing called 'finger trouble' that happens sometimes: you forget to backup the changes on one machine or another and suddenly, bam, your work vanishes. At least that is what I think happened, all I know is that twice now I have lost some work. Running backup and get scripts to synchronise two pc's against a server is too error prone for me. 
&lt;/p&gt;
&lt;p&gt;
So I set up &lt;a href="http://www.cis.upenn.edu/~bcpierce/unison/"&gt;unison&lt;/a&gt; which, once running, should be a less error prone solution. It will synchronise the files on my home and work pc's with the files on the server. Changes to the files may be propogated either way, depending on the time stamps. I can change the files on either pc and unison will help me resolve any conflicts I create. While it is synchronising it will prompt me with each file that has changed and ask me what to do with it so I can see if I am about to overwrite an evening's work. 
&lt;/p&gt;
&lt;p&gt;
I have the following unison profile file set up in my .unison directories on both pc's: 
&lt;/p&gt;
&lt;div class="verbatim-block"&gt;&lt;pre&gt;#
# Unison profile for project X
#
root = /cygdrive/c/projects/X
root = ssh://me@myserver.com//home/pcw/X

ignore = Name Downloads/*
ignore = Name Backup/*
ignore = Name Backups/*
ignore = Name Tmp/*
ignore = Name *.map
ignore = Name *~
ignore = Name *.obj
ignore = Name *.o
ignore = Name *.i

backup = Name *
backupdir = f:\users\pcw\BACKUP\X
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
If the profile file is called X.prf then I can synchronise this project by running 
&lt;/p&gt;
&lt;pre class="lazy"&gt;unison X
&lt;/pre&gt;
&lt;p&gt;
Because the profile is in my private .unison directory I don't even need to cd to the project directory. 
&lt;/p&gt;
&lt;p&gt;
The 'backup' and 'backupdir' lines at the end of the profile tell unison to maintain an extra local backup, in this case on our main file server such that the backups fall under our company tape backup procedure. 
&lt;/p&gt;
&lt;p&gt;
It has worked for a day now with fewer problems than rsync gave (and ironically unison uses rsync in it's underpinnings) and it is fast, taking less than a minute to work on 491 files. 
&lt;/p&gt;
&lt;p&gt;
To maintain straight backups unison would be overkill but where changes could be made to the files in more than one place it is looking good. 
&lt;/p&gt;
&lt;p&gt;
Of course, I could use unison with a flash drive rather than a file server but I don't have to remember to carry the server around with me. 
&lt;/p&gt;
&lt;p&gt;
And I know about &lt;a href="http://www.microsoft.com/windowsxp/using/digitalphotography/prophoto/synctoy.mspx"&gt;synctoy&lt;/a&gt; but unison works easily through an ssh tunnel. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/backup"&gt;backup&lt;/a&gt; &lt;a href="/tag/rsync"&gt;rsync&lt;/a&gt; &lt;a href="/tag/unison"&gt;unison&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1549</guid>
      <category domain="http://www.technorati.com/tag">backup</category>
      <category domain="http://www.technorati.com/tag">rsync</category>
      <category domain="http://www.technorati.com/tag">unison</category>
    </item>
    <item>
      <title>Backing up from Windows to a linux box</title>
      <link>http://www.petersblog.org/node/view/1527</link>
      <description>&lt;p&gt;
Another backing up setup is under construction. This time I'm backing up my project developed on a windows box to a linux server using &lt;a href="/tag/rsync"&gt;rsync&lt;/a&gt;. It is using &lt;a href="/tag/ruby"&gt;ruby&lt;/a&gt; as a scripting language. If this script is invoked thus: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;ruby Backup.rb
&lt;/pre&gt;
&lt;p&gt;
then this script will merely update a simple backup of the source directory on the server. rsync is very fast and will only spend time uploading files that have actually changed and also it will only upload the &lt;i&gt;changes&lt;/i&gt; to those files. I am using this on a 30M source archive and it takes less than a minute to update the backup. The backup files are just copies of the original files so easy to browse, diff, restore. 
&lt;/p&gt;
&lt;p&gt;
If the script is invoked thus: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;ruby Backup.rb --backup
&lt;/pre&gt;
&lt;p&gt;
then it will use rsync's magic link-dest option to create historical archive of backups. What the script will do is this: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
Move the current main backup to an archive directory and give that archive directory a name that is date/time stamped. 
&lt;/li&gt;
&lt;li&gt;
Create a new backup. Where files have not changed from the previous backup, the new backup will contain a link to the existing copy of the file in the archive, rather than consume more file space. The new backup directory will only contain files that are new or have been changed. 
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
There is nothing in the script to limit the number of backups but they can be manually pruned every few months as required. 
&lt;/p&gt;
&lt;p&gt;
This is the script: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; This script is used to backup the source code to an offsite server&lt;/span&gt;
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; If the parameter '--backup' is provided then create a backup directory&lt;/span&gt;
&lt;span class="line-numbers"&gt;   5 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   6 &lt;/span&gt; strMeAtMine &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;me@myserver.org&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   7 &lt;/span&gt; strLocalFolder &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;/cygdrive/c/projects/757/&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   8 &lt;/span&gt; strTargetFolder &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;/home/pcw/757&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   9 &lt;/span&gt; strBackupFolder &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;/home/pcw/Backup/757&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  10 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  11 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  12 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; If asked to backup then move previous backup to a backup directory&lt;/span&gt;
&lt;span class="line-numbers"&gt;  13 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; given a name related to date/time.&lt;/span&gt;
&lt;span class="line-numbers"&gt;  14 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  15 &lt;/span&gt; &lt;span class="Keyword"&gt;if&lt;/span&gt; &lt;span class="Variable"&gt;ARGV&lt;/span&gt;.&lt;span class="Entity"&gt;index&lt;/span&gt;( &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;--backup&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;span class="line-numbers"&gt;  16 &lt;/span&gt;   bBackup &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="Constant"&gt;true&lt;/span&gt;
&lt;span class="line-numbers"&gt;  17 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  18 &lt;/span&gt;   strTimeStamp &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="Support"&gt;Time&lt;/span&gt;.&lt;span class="Entity"&gt;now&lt;/span&gt;.&lt;span class="Entity"&gt;strftime&lt;/span&gt;( &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;%Y-%m-%d-%H-%M&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;span class="line-numbers"&gt;  19 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  20 &lt;/span&gt;   strBackupDir &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;span class="String"&gt;&lt;span class="String"&gt;#{&lt;/span&gt;strBackupFolder&lt;span class="String"&gt;}&lt;/span&gt;&lt;/span&gt;/&lt;span class="String"&gt;&lt;span class="String"&gt;#{&lt;/span&gt;strTimeStamp&lt;span class="String"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  21 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  22 &lt;/span&gt;   strCommand &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;ssh &lt;span class="String"&gt;&lt;span class="String"&gt;#{&lt;/span&gt;strMeAtMine&lt;span class="String"&gt;}&lt;/span&gt;&lt;/span&gt; mv &lt;span class="String"&gt;&lt;span class="String"&gt;#{&lt;/span&gt;strTargetFolder&lt;span class="String"&gt;}&lt;/span&gt;&lt;/span&gt; &lt;span class="String"&gt;&lt;span class="String"&gt;#{&lt;/span&gt;strBackupDir&lt;span class="String"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  23 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  24 &lt;/span&gt;   &lt;span class="Entity"&gt;system&lt;/span&gt;( strCommand)
&lt;span class="line-numbers"&gt;  25 &lt;/span&gt; &lt;span class="Keyword"&gt;else&lt;/span&gt;
&lt;span class="line-numbers"&gt;  26 &lt;/span&gt;   bBackup &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="Constant"&gt;false&lt;/span&gt;
&lt;span class="line-numbers"&gt;  27 &lt;/span&gt; &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;span class="line-numbers"&gt;  28 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  29 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  30 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; Determine location of rsync exluded file list&lt;/span&gt;
&lt;span class="line-numbers"&gt;  31 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  32 &lt;/span&gt; strDir &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="Support"&gt;File&lt;/span&gt;.&lt;span class="Entity"&gt;dirname&lt;/span&gt;( &lt;span class="Variable"&gt;__FILE__&lt;/span&gt;)
&lt;span class="line-numbers"&gt;  33 &lt;/span&gt; strExcludeFile &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="Support"&gt;File&lt;/span&gt;.&lt;span class="Entity"&gt;join&lt;/span&gt;( strDir, &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;rsync-exclude.txt&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)
&lt;span class="line-numbers"&gt;  34 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  35 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  36 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; Build command to invoke in an array of strings since this allows me to comment what&lt;/span&gt;
&lt;span class="line-numbers"&gt;  37 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; each parameter does.&lt;/span&gt;
&lt;span class="line-numbers"&gt;  38 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  39 &lt;/span&gt; strCommand &lt;span class="Keyword"&gt;=&lt;/span&gt; [ &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;rsync&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,
&lt;span class="line-numbers"&gt;  40 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt;  	&amp;quot;-n&amp;quot;,                                 # -n = dry run&lt;/span&gt;
&lt;span class="line-numbers"&gt;  41 &lt;/span&gt;   	&lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;-v&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,                                 &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; verbose&lt;/span&gt;
&lt;span class="line-numbers"&gt;  42 &lt;/span&gt;                 &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;-a&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,                                 &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; archiving options&lt;/span&gt;
&lt;span class="line-numbers"&gt;  43 &lt;/span&gt;                 &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;--delete&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,                           &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; delete files no longer used from target&lt;/span&gt;
&lt;span class="line-numbers"&gt;  44 &lt;/span&gt;                 &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;--chmod=u=rwX&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,                      &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; set target file permissions&lt;/span&gt;
&lt;span class="line-numbers"&gt;  45 &lt;/span&gt;                 &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;--exclude-from=&lt;span class="String"&gt;&lt;span class="String"&gt;#{&lt;/span&gt;strExcludeFile&lt;span class="String"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,   &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; exclude rubbish&lt;/span&gt;
&lt;span class="line-numbers"&gt;  46 &lt;/span&gt;                 &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;--delete-excluded&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,                  &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; delete excluded files from target&lt;/span&gt;
&lt;span class="line-numbers"&gt;  47 &lt;/span&gt;                 &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;-e ssh&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,                             &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; use ssh tunnel&lt;/span&gt;
&lt;span class="line-numbers"&gt;  48 &lt;/span&gt;                 strLocalFolder,                       &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; source&lt;/span&gt;
&lt;span class="line-numbers"&gt;  49 &lt;/span&gt;                 &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;span class="String"&gt;&lt;span class="String"&gt;#{&lt;/span&gt;strMeAtMine&lt;span class="String"&gt;}&lt;/span&gt;&lt;/span&gt;:&lt;span class="Constant"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="String"&gt;&lt;span class="String"&gt;#{&lt;/span&gt;strTargetFolder&lt;span class="String"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="Constant"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; target&lt;/span&gt;
&lt;span class="line-numbers"&gt;  50 &lt;/span&gt;             ]
&lt;span class="line-numbers"&gt;  51 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  52 &lt;/span&gt; &lt;span class="Keyword"&gt;if&lt;/span&gt; bBackup
&lt;span class="line-numbers"&gt;  53 &lt;/span&gt; &lt;span class="Comment"&gt;  &lt;span class="Comment"&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  54 &lt;/span&gt; &lt;span class="Comment"&gt;  &lt;span class="Comment"&gt;#&lt;/span&gt; Backing up so instead of uploading everything again, link to files in the&lt;/span&gt;
&lt;span class="line-numbers"&gt;  55 &lt;/span&gt; &lt;span class="Comment"&gt;  &lt;span class="Comment"&gt;#&lt;/span&gt; backup directory where there are no changes.&lt;/span&gt;
&lt;span class="line-numbers"&gt;  56 &lt;/span&gt; &lt;span class="Comment"&gt;  &lt;span class="Comment"&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  57 &lt;/span&gt;   strCommand.&lt;span class="Entity"&gt;insert&lt;/span&gt;( &lt;span class="Keyword"&gt;-&lt;/span&gt;&lt;span class="Constant"&gt;3&lt;/span&gt;, &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;--link-dest=&lt;span class="String"&gt;&lt;span class="String"&gt;#{&lt;/span&gt;strBackupDir&lt;span class="String"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)
&lt;span class="line-numbers"&gt;  58 &lt;/span&gt; &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;span class="line-numbers"&gt;  59 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  60 &lt;/span&gt; &lt;span class="Entity"&gt;system&lt;/span&gt;( strCommand.&lt;span class="Entity"&gt;join&lt;/span&gt;(&lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt; &lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;))
&lt;/pre&gt;
&lt;p&gt;
Since this is a backup of files from a windows box to linux I used the "--chmod=u=rwX" to specify simple file permissions on the linux end. Without this rsync was tending to create files with no access permissions for anyone. 
&lt;/p&gt;
&lt;p&gt;
The 'rsync-exclude.txt' file lives in the same directory as the script and the script uses some magic to find it. This is a list of stiff that doesn't need backing up: 
&lt;/p&gt;
&lt;div class="verbatim-block"&gt;&lt;pre&gt;/Downloads
*.map
Backup/*
Backups/*
*~
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
This uses the &lt;a href="/tag/cygwin"&gt;cygwin&lt;/a&gt; version of rsync which uses ssh to talk to the remote server. I have ssh set up with key files so I don't need to enter passwords. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/backup"&gt;backup&lt;/a&gt; &lt;a href="/tag/rsync"&gt;rsync&lt;/a&gt; &lt;a href="/tag/ruby"&gt;ruby&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1527</guid>
      <category domain="http://www.technorati.com/tag">backup</category>
      <category domain="http://www.technorati.com/tag">rsync</category>
      <category domain="http://www.technorati.com/tag">ruby</category>
    </item>
    <item>
      <title>Vista backup</title>
      <link>http://www.petersblog.org/node/view/1515</link>
      <description>&lt;p&gt;
Vista has a new and improved backup facility. This is what Microsoft has to say: 
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
"The file backup feature in Windows Vista is targeted at the core consumer audience. To savvy users, it will appear quite simple, probably too simple for you to use. For most consumers, however, it will hopefully be the right balance of complexity and functionality to get them backing up their files, which is something virtually none of them did in Windows XP, no matter how capable the tool was. For core consumers, we wanted to eliminate the confusion caused by selecting individual folders and files from a long tree of checkboxes, trying to find or guess where other users kept their files, predicting where files would be stored in the future, etc. These choices added too much complexity to the backup process and discouraged users from using NTBackup." &lt;/blockquote&gt; 
&lt;/p&gt;
&lt;p&gt;
I tried to use it, clicked ok in the UAP box and got this: 
&lt;/p&gt;
&lt;div style="text-align:center"&gt;&lt;img src="/images/VistaBackup.jpg" alt="images/VistaBackup.jpg"/&gt;&lt;/div&gt; 
&lt;p&gt;
I'm not sure where this puts me in the demographics. I'm savvy enough to see that it doesn't look that simple to get it running and as a normal consumer I'd say the available functionality won't get me backing up my files. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/backup"&gt;backup&lt;/a&gt; &lt;a href="/tag/buggycrap"&gt;buggycrap&lt;/a&gt; &lt;a href="/tag/vista"&gt;vista&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1515</guid>
      <category domain="http://www.technorati.com/tag">backup</category>
      <category domain="http://www.technorati.com/tag">buggycrap</category>
      <category domain="http://www.technorati.com/tag">vista</category>
    </item>
    <item>
      <title>Mozy</title>
      <link>http://www.petersblog.org/node/view/1462</link>
      <description>&lt;p&gt;
Following &lt;a href="/node/1458"&gt;my ruminations on online backup&lt;/a&gt; I'm giving &lt;a href="http://www.mozy.com"&gt;mozy&lt;/a&gt; a try with the 2G free space plan. I selected 800M of stuff to backup and it's still working on uploading it. The signup wasn't problem free with one or two timeouts and the setup program was disdainful about my upload speed, saying it wasn't good enough but allowing me to proceed anyway. It will take a few days to backup everything. The backup seems to be interrupted whenever I use the computer (like Google Desktop Search) probably because Windows is so poor at multitasking disk intensive applications. How often do I stop using the computer for more than a minute? Not very often it seems (is it coffee time yet?). 
&lt;/p&gt;
&lt;p&gt;
There is a web-based interface that will let me restore files and would presumably let me download them to wherever I happened to be. It doesn't seem to let you view the files online in your browser which would be very handy, especially for pictures, you can only download the files. Overall it is not as flexible as xdrive promises but it could be handy one day. 
&lt;/p&gt;
&lt;p&gt;
Mozy adds a 'Mozy Remote Backup' virtual drive to windows explorer but for me it refuses to open: I click on it but the selection bounces away in buggy fashion. I presume it is supposed to show the folders and files I have backed up and allow me to restore them with drag and drop. 
&lt;/p&gt;
&lt;p&gt;
Maybe I should bite the AOL bullet and try &lt;a href="http://www.xdrive.com"&gt;xdrive&lt;/a&gt;. It would be more flexible even if backup was not totally automatic and didn't offer file versioning. It also gives 5G of space for free but I just cannot help feeling that AOL don't give anything away without a catch. Will they start emailing me .iso disk images? 
&lt;/p&gt;
&lt;p&gt;
What I should really be concentrating on is having something like Mozy to backup everyday work in progress and a source control system such as Subversion to handle the versioning of project files. That is the best option. The source control system only holds working code, I don't believe in checking half-finished rubbish in every day just so it is backed up. The backup system is there to save your behind if your hard disk goes down or you accidently delete a file. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/backup"&gt;backup&lt;/a&gt; &lt;a href="/tag/mozy"&gt;mozy&lt;/a&gt; &lt;a href="/tag/xdrive"&gt;xdrive&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1462</guid>
      <category domain="http://www.technorati.com/tag">backup</category>
      <category domain="http://www.technorati.com/tag">mozy</category>
      <category domain="http://www.technorati.com/tag">xdrive</category>
    </item>
    <item>
      <title>Online Backup</title>
      <link>http://www.petersblog.org/node/view/1458</link>
      <description>&lt;p&gt;
Researching online backup solutions: really must backup family photos properly. Options so far: 
&lt;/p&gt;
&lt;p&gt;
 &lt;a href="http://www.mozy.com"&gt;mozy&lt;/a&gt;: 2G free or $4.95 a month unlimited. Automated backup and offers file versioning for a month which would be handy. Files accessable from web. 
&lt;/p&gt;
&lt;p&gt;
 &lt;a href="http://www.carbonite.com"&gt;carbonite&lt;/a&gt;: a different shade of mozy, horses for courses. Trial account but no long term free account. 
&lt;/p&gt;
&lt;p&gt;
 &lt;a href="http://www.xdrive.com"&gt;xdrive&lt;/a&gt;: 5G free which is enough. Creates a virtual drive which you copy files to however you like or run their backup software. Web based access to files from anywhere, file sharing, lots of nice features. What puts me off? It's owned by AOL &lt;img alt="sad" src="/images/smileys/sad.png" /&gt; 
&lt;/p&gt;
&lt;p&gt;
 &lt;a href="http://www.flickr.com"&gt;flickr&lt;/a&gt;: could just upload multiple G of photos to flickr but since they decided to force me to get a yahoo account I haven't been using flickr (yahoo or AOL, I don't want the hassle). Also the upload wouldn't be as totally automatic as mozy or carbonite. 
&lt;/p&gt;
&lt;p&gt;
 &lt;a href="http://www.site5.com"&gt;site5&lt;/a&gt;: I could cobble something together on my site5 hosting account: I have about 14G free and ssh access so I should be able to do something but it will be a lashup that I would have to nurse along. 
&lt;/p&gt;
&lt;p&gt;
Being a dedicated backup solutions, Mozy or Carbonite would almost force me to do backups and do them well. With anything that looked like another hard disk I would end up with yet another disorganised mess. Less flexibility than xdrive could be a good thing. And by avoiding AOL and yahoo I stick it to "the man". 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/backup"&gt;backup&lt;/a&gt; &lt;a href="/tag/flickr"&gt;flickr&lt;/a&gt; &lt;a href="/tag/mozy"&gt;mozy&lt;/a&gt; &lt;a href="/tag/site5"&gt;site5&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1458</guid>
      <category domain="http://www.technorati.com/tag">backup</category>
      <category domain="http://www.technorati.com/tag">flickr</category>
      <category domain="http://www.technorati.com/tag">mozy</category>
      <category domain="http://www.technorati.com/tag">site5</category>
    </item>
    <item>
      <title>Yet Another Backup Strategy</title>
      <link>http://www.petersblog.org/node/view/1102</link>
      <description>&lt;p&gt;
Since plugging &lt;a href="/node/1100"&gt;Cobian Backup&lt;/a&gt; last week I have noticed that it leaves two processes running all the time, committing about 15M of memory, 7M of it for a UI to support a status icon, the rest for the backup service. Since the backup only runs once a day for a minute or so I don't see the point of committing resources all the time: the Windows scheduler service is running all the time anyway, so why run another service to do backups? 
&lt;/p&gt;
&lt;p&gt;
I've written a new batch file to do a rolling backup using &lt;a href="http://www.7-zip.org/"&gt;7zip&lt;/a&gt;, a very nice compression package: 
&lt;/p&gt;
&lt;div class="verbatim-block"&gt;&lt;pre&gt;rem
rem yet  another backup script
rem
erase &amp;quot;%2\Backup9.7z&amp;quot;
move &amp;quot;%2\Backup8.7z&amp;quot; &amp;quot;%2\Backup9.7z&amp;quot;
move &amp;quot;%2\Backup7.7z&amp;quot; &amp;quot;%2\Backup8.7z&amp;quot;
move &amp;quot;%2\Backup6.7z&amp;quot; &amp;quot;%2\Backup7.7z&amp;quot;
move &amp;quot;%2\Backup5.7z&amp;quot; &amp;quot;%2\Backup6.7z&amp;quot;
move &amp;quot;%2\Backup4.7z&amp;quot; &amp;quot;%2\Backup5.7z&amp;quot;
move &amp;quot;%2\Backup3.7z&amp;quot; &amp;quot;%2\Backup4.7z&amp;quot;
move &amp;quot;%2\Backup2.7z&amp;quot; &amp;quot;%2\Backup3.7z&amp;quot;
move &amp;quot;%2\Backup.7z&amp;quot; &amp;quot;%2\Backup2.7z&amp;quot;

&amp;quot;c:\program files\7-zip\7z&amp;quot; a -r -x@&amp;quot;c:\bin\exclude.txt&amp;quot; &amp;quot;%2\Backup.7z&amp;quot; &amp;quot;%1\*
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
Exclude.txt is a list of file extensions that should not be backed up. 
&lt;/p&gt;
&lt;p&gt;
A wrapper batch file is created to call the above for each backup source: 
&lt;/p&gt;
&lt;div class="verbatim-block"&gt;&lt;pre&gt;c:\bin\backup c:\desktop g:\backup\desktop
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
and this wrapper is run from the &lt;a href="/tag/windows"&gt;Windows&lt;/a&gt; scheduler. 
&lt;/p&gt;
&lt;p&gt;
I am using 7zip because of the way it allows a source directory to be specified: I'm not sure regular &lt;a href="http://www.info-zip.org/pub/infozip/"&gt;info-zip&lt;/a&gt; supports this so cleanly. 
&lt;/p&gt;
&lt;p&gt;
7Zip native zip format creates smaller archive files than regular zip (albeit more slowly) and yet &lt;a href="/tag/salamander"&gt;salamander&lt;/a&gt; still allows me to view them like regular directories so for me there is no practical difference between zip and 7zip. 7zip can be told to create regular zip files is need be. 
&lt;/p&gt;
&lt;p&gt;
7Zip supports incremental backups and if my backup files became very large I would consider using it but the external hard disk that I backup to is 80G and has space aplenty so there isn't much to be gained from this. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/backup"&gt;backup&lt;/a&gt; &lt;a href="/tag/windows"&gt;windows&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1102</guid>
      <category domain="http://www.technorati.com/tag">backup</category>
      <category domain="http://www.technorati.com/tag">windows</category>
    </item>
    <item>
      <title>Cobian backup 7</title>
      <link>http://www.petersblog.org/node/view/1100</link>
      <description>&lt;p&gt;
Found &lt;a href="http://www.educ.umu.se/~cobian/cobianbackup.htm"&gt;Cobian Backup&lt;/a&gt; a nice windows tool for doing automated backups. What is nice about it is that it backs up to zip files so backups are nicely compressed in a non-proprietary format and restoring then does not need any special tools: I can browse the archives from &lt;a href="/tag/salamander"&gt;salamander&lt;/a&gt;, view them and copy them individually or on mass. It can be set up to do incremental backups every day, a full backup every week and to keep backups of every backup so you have some kind of history. 
&lt;/p&gt;
&lt;p&gt;
I am using it simply to archive my work in progress: the computer I am using dies randomly once or twice a week and I don't trust it (it flashes a blue screen and reboots). 
&lt;/p&gt;
&lt;p&gt;
I set up the scheduler to do the backup every lunch time, backing up my desktop (where I chuck everything these days) to an external USB hard disk. 
&lt;/p&gt;
&lt;p&gt;
The only bugbear I have with it is that it is tedious to  get it to exclude files by extension: you have to add them one at a time (click add, enter extension, ok, click add..) and with VC development there are many extensions that can be excluded from backup: my typical list of exclusions is: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
*.obj 
&lt;/li&gt;
&lt;li&gt;
*.sbr 
&lt;/li&gt;
&lt;li&gt;
*.bsc 
&lt;/li&gt;
&lt;li&gt;
*.zip 
&lt;/li&gt;
&lt;li&gt;
*.map 
&lt;/li&gt;
&lt;li&gt;
*.wsp 
&lt;/li&gt;
&lt;li&gt;
*.pdb 
&lt;/li&gt;
&lt;li&gt;
*.pch 
&lt;/li&gt;
&lt;li&gt;
*.tmp 
&lt;/li&gt;
&lt;li&gt;
*.res 
&lt;/li&gt;
&lt;li&gt;
*.ilk 
&lt;/li&gt;
&lt;li&gt;
*.exp 
&lt;/li&gt;
&lt;li&gt;
*.idb 
&lt;/li&gt;
&lt;li&gt;
*.ncb 
&lt;/li&gt;
&lt;li&gt;
*.opt 
&lt;/li&gt;
&lt;li&gt;
*.plg 
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
It seems to store it's configurations in C:\Program Files\Cobian Backup 7\DB\MainList.lst which is a text file so I edited it in &lt;a href="/tag/vim"&gt;Vim&lt;/a&gt;, rebooted Cobian and job done. 
&lt;/p&gt;
&lt;p&gt;
Many quality windows freeware tools listed &lt;a href="http://100-downloads.com/"&gt;here&lt;/a&gt; and &lt;a href="http://www.techsupportalert.com/best_46_free_utilities.htm"&gt;here&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
Another good source of free stuff is &lt;a href="http://del.icio.us/popular/free"&gt;this&lt;/a&gt;. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/backup"&gt;backup&lt;/a&gt; &lt;a href="/tag/windows"&gt;windows&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1100</guid>
      <category domain="http://www.technorati.com/tag">backup</category>
      <category domain="http://www.technorati.com/tag">windows</category>
    </item>
    <item>
      <title>Unison</title>
      <link>http://www.petersblog.org/node/view/1086</link>
      <description>&lt;p&gt;
I've been plying with &lt;a href="http://www.cis.upenn.edu/~bcpierce/unison/"&gt;unison&lt;/a&gt; recently, as a means of replicating my collection of 3000 photos between two computers: I nearly lost all the family photos once &lt;a href="/node/204"&gt;before&lt;/a&gt;, and I have been neglecting backups. With my new strategy of having the dell &lt;a href="/tag/d410"&gt;D410&lt;/a&gt; fire up in it's docking station every night and doing backups, it can also synchronise the photo collection with the 500m which runs all the time. 
&lt;/p&gt;
&lt;p&gt;
The advantage of unison over rsync is that it synchronises a pair of directories, i.e. if you add, edit or delete files on one copy then the other copy will be updated accordingly. This is a bi-directional thing, changes made to the second copy will be replicated in the first. In the case of my photo's, I always use the 500m to copy them from the camera but I am likely to use the D410 to manipulate them and what I want is changes in one archive to be fed into the other. 
&lt;/p&gt;
&lt;p&gt;
The invocation of unison that I have come up with so far is: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;unison -batch -fastcheck true &lt;span class="Keyword"&gt;&amp;lt;&lt;/span&gt;path&lt;span class="Keyword"&gt;1&amp;gt;&lt;/span&gt; &lt;span class="Keyword"&gt;&amp;lt;&lt;/span&gt;path&lt;span class="Keyword"&gt;2&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;dl&gt;&lt;dt&gt;-batch&lt;/dt&gt;&lt;dd&gt;
tells unison not to ask me stupid questions, it will reconcile problems automatically where it can. -force &lt;path1&gt; can be used toi resolve conflicts in favour of one of the paths. 
&lt;/dd&gt;
&lt;dt&gt;-fastcheck true&lt;/dt&gt;&lt;dd&gt;
tells it to compare files by timestamp and length rather than a full binary compare, as is the default under windows. 
&lt;/dl&gt;&lt;/dd&gt;

&lt;p&gt;
I have been using a native windows build of unison rather than the &lt;a href="/tag/cygwin"&gt;cygwin&lt;/a&gt; version, mainly because the windows version handles windows file names transparently, including network file names. cygwin unison via ssh does not seem to be able to find any of the file paths I give it (e.g. /cygdrive/c/blah, the cygwin form of c:\blah) and doesn't like network path names (e.g. \\server\share). 
&lt;/p&gt;
&lt;p&gt;
Still, it is not working properly for my photo collection but it may be because the network is not reliable enough to handle 3000 photos and 3G worth of data with absolutely no network problems. This may be another sign that the Wifi on the 500m is iffy (iffy wifi ha!) as the d410 in it's docking station has wired networking available. 
&lt;/p&gt;
&lt;p&gt;
Have I mentioned recently that the d410 is really nice? The 500m screen seems huge when I go back to it but the d410 is so fast, small and light. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/backup"&gt;backup&lt;/a&gt; &lt;a href="/tag/rsync"&gt;rsync&lt;/a&gt; &lt;a href="/tag/unison"&gt;unison&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1086</guid>
      <category domain="http://www.technorati.com/tag">backup</category>
      <category domain="http://www.technorati.com/tag">rsync</category>
      <category domain="http://www.technorati.com/tag">unison</category>
    </item>
    <item>
      <title>Dell D410 Docking Station</title>
      <link>http://www.petersblog.org/node/view/1081</link>
      <description>&lt;p&gt;
What with it being the Christmas holidays I found a spare couple of hours to set up the Docking Station for my Dell &lt;a href="/tag/d410"&gt;D410&lt;/a&gt; Laptop. I set it up thusly: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
17" CRT monitor 
&lt;/li&gt;
&lt;li&gt;
Packard bell keyboard 
&lt;/li&gt;
&lt;li&gt;
Packard bell wireless mouse 
&lt;/li&gt;
&lt;li&gt;
USB 2 Hub 
&lt;/li&gt;
&lt;li&gt;
External USB hard Drive 
&lt;/li&gt;
&lt;li&gt;
Wired network so I can play with wake-on-lan and access it from the internet 
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
I need to buy a long audio cable so I can plug it into the hifi. 
&lt;/p&gt;
&lt;p&gt;
It makes a nice system, the Dell is faster than the &lt;a href="/node/380"&gt;desktop&lt;/a&gt;. I still use the desktop system for the following: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
Canon USB Scanner 
&lt;/li&gt;
&lt;li&gt;
Nightly backup of remote server 
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
I could do my scanning on the laptop and I could set it up to do the nightly server backup as well. Since I set the desktop machine up for nightly backup I haven't got around to getting it to shut down automatically so one of my bedtime tchores is to turn it off. Once that is done I don't need the desktop... 
&lt;/p&gt;
&lt;p&gt;
I would like to set the laptop up for a nightly backup to the external hard disk: turn itself on at 3am, backup, then switch itself off. I'd like to figure out the most efficient way to do that: weekly full, and daily incremental maybe. This could be combined with the remote server backup. 
&lt;/p&gt;
&lt;p&gt;
The only disadvantage of a laptop over a desktop for me is that it has no PCI slots: the only PCI slot I could use is my TV card and I only need that to capture my wedding video (2 years, 3 months, still haven't got around to doing that). I'm not into games now (did I mention I'm married?) so I'm not inclined to upgrade the graphics: I'd buy an XBox 360 for that. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/backup"&gt;backup&lt;/a&gt; &lt;a href="/tag/d410"&gt;d410&lt;/a&gt; &lt;a href="/tag/dell"&gt;dell&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1081</guid>
      <category domain="http://www.technorati.com/tag">backup</category>
      <category domain="http://www.technorati.com/tag">d410</category>
      <category domain="http://www.technorati.com/tag">dell</category>
    </item>
  </channel>
</rss>
