Slashdot Mirror


Ask Slashdot: Temporary Backup Pouch?

An anonymous reader writes "It looks simple. I've got a laptop and a USB HDD for backups. With rsync, I only move changes to the USB HDD for subsequent backups. I'd like to move these changes to a more portable USB stick when I'm away, then sync again to the USB HDD when I get home. I figured with the normality of the pieces and the situation, there'd be an app for that, but no luck yet. I'm guessing one could make a hardlink parallel-backup on the laptop at the same time as the USB HDD backup. Then use find to detect changes between it and the actual filesystem when it's time to backup to the USB stick. But there would need to be a way to preserve paths, and a way communicate deletions. So how about it? I'm joe-user with Ubuntu. I even use grsync for rsync. After several evenings of trying to figure this out, all I've got is a much better understanding of what hardlinks are and are not. What do the smart kids do? Three common pieces of hardware, and a simple-looking task."

153 comments

  1. The smart kids by Anonymous Coward · · Score: 1, Funny

    What do the smart kids do?

    The smart kids don't use linux.

    1. Re:The smart kids by ThePeices · · Score: 2, Informative

      You Sir are completely correct.

      The smart kids use Linux.

    2. Re:The smart kids by ozmanjusri · · Score: 1

      Even smarter kids use Linux, udev and maybe Bacula, though Google would be a good start.

      --
      "I've got more toys than Teruhisa Kitahara."
    3. Re:The smart kids by Anonymous Coward · · Score: 0

      Wrong: the smart kids use GNU/Linux.

  2. Hardlinks by funwithBSD · · Score: 2, Informative

    Oh dear.

    Hardlinks don't span storage devices. They are files that share the same inodes on single storage device. Soft links do, but they are pointers to the inode, so "backup" using softlinks and you have a bunch of pointers to data that is on the original system. NOT on the thumb drive!

    Use one of the backup packages out there, you are not at the point of rolling your own.

    Not even close.

    --
    Never answer an anonymous letter. - Yogi Berra
    1. Re:Hardlinks by partofme · · Score: 2

      Hardlinks don't span storage devices.

      Except they do, on Windows at least. And you can even mount drive to a folder like c:/otherdrive/

    2. Re:Hardlinks by Anonymous Coward · · Score: 4, Funny

      Nobody pretended this to be the case. Not even the article's author. Please read again - and use a ghostwriter, you are not at the point of rolling your own comments. Not even close.

    3. Re:Hardlinks by maevius · · Score: 2

      mmmmm no.

      Mounting a drive to a folder has nothing to do with hardlinks (or inodes). This is on a much higher level. In order to span hardlinks on different drives, you should have 1 filesystem on 2 drives, which is not possible.

    4. Re:Hardlinks by tywjohn · · Score: 0

      funwithBSD is 100% correct about hard links it is quite clear that nobody is referring to Windows.

    5. Re:Hardlinks by Anonymous Coward · · Score: 0

      mmmmm no.

      Mounting a drive to a folder has nothing to do with hardlinks (or inodes). This is on a much higher level. In order to span hardlinks on different drives, you should have 1 filesystem on 2 drives, which is not possible.

      I'm not trolling here, I may be misunderstanding the concept. But isn't that what ZFS is about?

    6. Re:Hardlinks by tywjohn · · Score: 0

      Having one filesystem across multiple drives IS possible. Hardlinks spanning multiple filesystems is not.

    7. Re:Hardlinks by maevius · · Score: 1

      Ok, Let me clarify this.

      It is possible to span a filesystem on multiple drives (see various LVMs, RAID etc) but is offtopic to the problem at hand (you cannot have 1 filesystem on your hard drive and your USB stick).

      Given that hardlinks exist on the filesystem level, anything that is on a lower layer and transparent to this level (consider a driver for example that can handle hard disks, network paths, RAM etc. as 1 block device) can be on 1 filesystem and have hardlinks span across. But this purely theoretical, and a bit offtopic.

    8. Re:Hardlinks by LordLimecat · · Score: 1

      Not correct. You can make symlinks on Windows, but the data doesnt get stored in both locations. Ditto with hardlinks, on windows.

    9. Re:Hardlinks by funwithBSD · · Score: 1

      Don't normally respond to cowards, but the author did say he was trying to do backups using "hardlink parallel-backup", which is so much gobbledygook as to make it clear they don't understand UNIX past the "I am dangerous" level.

      Again, keep searching, find a package that can do 90% of what you want.

      Use that.

      --
      Never answer an anonymous letter. - Yogi Berra
  3. unison-gtk by niftydude · · Score: 3, Informative

    Since you are an ubuntu user, and it looks like you just need a nice rsync front-end to handle backup of the same data to two different drives, I'll suggest unison-gtk.

    Very nice, simple front-end, and will do what I think you need.

    --
    You can never know everything, and part of what you do know will always be wrong. Perhaps even the most important part.
    1. Re:unison-gtk by Dynetrekk · · Score: 1

      +1 for unison, it's an awesome little program. I use it on macosx as well, and I believe there's a windows client. I personally prefer the CLI version, but if the GUI version is anywhere near as good, I'll heartily recommend it. What you would do after coming home is to run sync against both external storages. Should work like a charm.

    2. Re:unison-gtk by Anonymous Coward · · Score: 0

      There is a Unison for Windows and, by and large, it works pretty well. (It certainly beats plain-old-rsync for merge syncing two server volumes between continents, both in initial scan times and transfer speeds.) The Unison server on Windows is a bit flaky and needs to be monitored - sometimes it quits for no logged reason.

    3. Re:unison-gtk by Anonymous Coward · · Score: 4, Informative

      I think people (including you) don't understand what he needs. He has a complete backup at home. When he's on the move, he wants to backup only modifications that are not already backed up at home, so that the backup fits on a USB stick. To know what has and hasn't changed, he can't access the backup at home, like rsync would need to do. His idea was to have a space-saving complete copy of the backup on his laptop via hard links. You might think that file modification times could be used, but both solutions leave the problem of communicating file deletion. Suppose he needs to recover. He would copy his home backup to the new drive and then he would have to integrate the incremental backup. How would the incremental backup keep the information about deleted files without access to the base backup? I suppose one could keep a recursive directory listing with the incremental backup, but that's the question: Is there a ready-made solution for this?

    4. Re:unison-gtk by Anonymous Coward · · Score: 0

      Windows is a bit flaky and needs to be monitored - sometimes it quits for no logged reason.

      Well fuck me dead!

      I never thought I'd be agreeing with a MS astroturfer!

    5. Re:unison-gtk by aaarrrgggh · · Score: 1

      It would seem to make more sense to approach the problem from a different direction: limit your USB backups to the home directory (or a limited set of directories), and do incremental backups there. In the recovery mode, you first recover to the last known good state from the hard drive, and then you apply the changes from the USB stick to selected directories. It could be automated with a script that even I could write, or you just follow a simple step-by-step procedure.

      A fully packaged solution as the OP wants would be nice; you would just need to make recursive hash tables of each directory that get you down to around 20-50MB chunk sizes wherever possible. I was hoping for something similar to help with backup drive validation to detect corruption. The table itself would be about 2MB if my math is right.

    6. Re:unison-gtk by cfulton · · Score: 1

      Somebody give the above a +1 (on topic) for actually trying to answer the question!!!

      --
      No sigs in BETA. Beta SUCKS.
    7. Re:unison-gtk by Hatta · · Score: 3, Informative

      To know what has and hasn't changed, he can't access the backup at home, like rsync would need to do.

      If I understand correctly BackupPC caches the checksums rsync generates to enable exactly that. It would be nice if that was possible with vanilla rsync.

      --
      Give me Classic Slashdot or give me death!
  4. Re:SkyDrive by Zemran · · Score: 1

    Did you read the summary? Obviously Skydrive is of no use but there are several other alternatives that would be better suited to this purpose although if, as he says, it is for use while travelling an internet based system is useless. I would suggest reading up more on what you can do with dd and writing a couple of scripts to suit your needs. The problems are more likely to be around using USB but you can always write a script that puts a compressed file on your desktop that you manually copy to your USB stick. Old tech is normally most reliable.

    --
    I love stacking my barbecues in the shed at the end of summer - you can't beat a bit of grill on grill action.
  5. Unison? by Anonymous Coward · · Score: 3, Informative

    I hesitate to offer this, because I've not experimented with it in the precise scenario you describe. However, being another Joe User with ubuntu, I took a look at rsync as a way to implement backups between my home PC and an Apple Time capsule that I was using as a secondary backup device.

    After some tinkering I settled on Unison, which is available in the ubuntu repositories. It's essentially a sophisticated rsync front end, with a few bells and whistles. You get 2-way directory replication between your 'local' and 'remote' file systems [though they could both be local or both remote if you choose] and you can essentially script multiple different backups into the single interface. For example, I have "Office" for documents, spreadsheets and the like, "Photos", for camera images, "Music", and so on.

    Like most tools, Unison is imperfect, but it's simple to use once set up. The key point with it, as with any product you put in this space, will be knowing and keeping track of your definitive data source. If you have a document that exists on both your local and backup systems, and you edit that file separately at each location, then run Unison, only the most chronologically recent copy will be preserved. To go beyond this level of functionality and get to something that can intelligently merge changes, I think you're going to need something more like a CVS tool... There are hugely expensive proprietary solutions (like Livelink), but I've not come across anyone using a good FOSS alternative. HTH...

    1. Re:Unison? by Anonymous Coward · · Score: 0

      yeah, you're going to need something like git to deal with complicated file histories and multiple outstanding changes

      so why not use something like git?

    2. Re:Unison? by Anonymous Coward · · Score: 0

      If you want a user-friendly git-based backup, look into sparkleshare. But revision history is probably not important for most backup applications.

    3. Re:Unison? by Neil_Brown · · Score: 1

      Like the GP, I haven't used Unison in this context, but (a) Unison is easy to configure, and (b) there's plenty of configuration which can be done. I use it for keeping my machines in sync, which, here, would just mean replacing a remote path with a local path. I would definitely invest some time in seeing if this does the trick.

    4. Re:Unison? by Anonymous Coward · · Score: 1

      Unison is NOT essentially an rsync frontend. It uses librsync, sure, but it is also a heavily researched, heavily modified way of backing up and synching files.

      Here is their homepage: http://www.cis.upenn.edu/~bcpierce/unison/index.html

      Unison can work in two ways, seeing if you also put files on the backupdrive that you want to synch back into the main repository. This is an option though, but
      I suspect MANY of the file-backup services like dropbox base their code on Unison.

      I have always been satisfied with the stability of Unison. When it is set up it never hangs, crashes or things like that.
      So in sum: I second that, go with Unison.

    5. Re:Unison? by Dynetrekk · · Score: 0

      After some tinkering I settled on Unison, which is available in the ubuntu repositories. It's essentially a sophisticated rsync front end, with a few bells and whistles.

      It is, in fact, a bit more than that. rsync doesn't handle deletions, so your backup will keep growing in size even though you're not really making any additions (say, you're renaming a big file - now that file is copied twice). unison does, however. This is essential for this use case, especially if one of the backup devices has somewhat limited space on it.

    6. Re:Unison? by DrVxD · · Score: 5, Informative

      rsync doesn't handle deletions

      rsync handles deletions just fine - that's why it has a --delete option...

      --
      Not everything that can be measured matters; Not everything that matters can be measured.
    7. Re:Unison? by Dynetrekk · · Score: 1

      Hey cool. But what if you bring your USB stick "backup" to some friends, and then add or modify files on the stick? Unison will let you sync those changes back to your desktop when you get home. Does rsync do that, too?

    8. Re:Unison? by Anonymous Coward · · Score: 0

      Seriously dude...

      Make two maps on your USB stick, and use one for your backups and the other for file transfers.

      Or... man rsync, if you really want to use rsyncs advanced options, which it has in dizzying abundance!

    9. Re:Unison? by ThePortlyPenguin · · Score: 1

      +1 for Unison. It will do everything you need it to, and is easy to use. You can setup your ~/.unison/*.prf files to have multiple roots on the same machine (one per removable drive in your case). Just pick the one you want to use when you sync. It does a better job of intelligently syncing and handling any resulting conflicts than anything else out there, bar none. It handles deletions fine (as does, btw, rsync). Here's a sample default.prf for your scenario:

      root = /home/yourusername
      root = /media/usbhdd

      path = Documents
      path = Music
      path = Pictures

    10. Re:Unison? by DrVxD · · Score: 2

      Yes.

      --
      Not everything that can be measured matters; Not everything that matters can be measured.
    11. Re:Unison? by Anonymous Coward · · Score: 0

      From the rsync man page:

      --del an alias for --delete-during
      --delete delete extraneous files from dest dirs
      --delete-before receiver deletes before transfer (default)
      --delete-during receiver deletes during xfer, not before
      --delete-delay find deletions during, delete after
      --delete-after receiver deletes after transfer, not before
      --delete-excluded also delete excluded files from dest dirs

      rsync handles deletions quite well. AFAIK, it doesn't handle renaming, your example, most efficiently but it gets the job done eventually.

  6. DirSyncPro by KingAlanI · · Score: 2

    I use DirSyncPro to automate my backup tasks. Not sure how to set it up for your particular task, or whether you can, but it might be worth looking into. A lot of options while still being easy to use.

    --
    I listen to both RIAA and non-RIAA stuff if I like the music, tangential business/politics nonwithstanding.
    1. Re:DirSyncPro by Anonymous Coward · · Score: 1

      Thank god its got 'pro' in the name, theres just one thing stopping me getting it now, I'll wait for 'deluxe' to be added to the name, that'll do it.

    2. Re:DirSyncPro by KingAlanI · · Score: 1

      haha...it's another FOSS multiplatform thing

      --
      I listen to both RIAA and non-RIAA stuff if I like the music, tangential business/politics nonwithstanding.
  7. Duplicity, perhaps by Wizarth · · Score: 3, Informative

    Duplicity uses librsync to generate the changeset that rsync would use, then stores the change set. If you stored the change set to the USB drive, this could then be "restored" to the destination drive, perhaps? I don't know if there's any way to do this out of the box, or with a bit of scripting, or if this would need to be a whole new toolchain.

    1. Re:Duplicity, perhaps by Anonymous Coward · · Score: 0

      There is a nice duplicity front end for ubuntu called dubli.back that I use. http://code.google.com/p/dupliback/

    2. Re:Duplicity, perhaps by Anonymous Coward · · Score: 0

      Yeah, Duplicity is a good choice. It compresses and encrypts the backup volumes for you. I'd recommend using that instead of rsync when backing up to both the USB stick and the USB HDD, and then using rsync for syncing the backup volumes when at home.

    3. Re:Duplicity, perhaps by Weezul · · Score: 2

      I suspect duplicity and git-annex are the only correct answers in this thread because the underlying problem is that your rsync like tool must detect the changes using a listing of file hashes, not access to the files themselves. It's the same problem as doing incremental backups to a host not running specialized incremental backup software. Duplicity does this, but rsync does not afaik.

      --
      The Christian religion has been and still is the principal enemy of moral progress in the world. -- Bertrand Russell
  8. not rsync by Anonymous Coward · · Score: 2, Interesting

    there are better solutions than rsync.
    rdiff-backup
    dupicity
    for example.

    i probably don't understand what you are trying to accomplish.

  9. Re:SkyDrive by partofme · · Score: 2

    I can't see how internet based system would be useless. SkyDrive and Dropbox both can sync files when you get internet connection. I am traveling too (have been for 4 months) and that's what I do, even while internet is really crap at times. But it will get synced eventually, and it gets synced automatically without me doing anything. On top of that de-duplication and only syncing parts that need to be uploaded saves bandwidth.

    rsync and other low level solutions are much more work and on top of that you need to carry around extra devices that might get destroyed too. But with SkyDrive or Dropbox the files will always be there no matter what happens.

  10. dump(8) by Anonymous Coward · · Score: 2, Interesting

    this is what dump(8) does

    1. Re:dump(8) by kiite · · Score: 1

      Unfortunately, dump requires a supported filesystem. But most people forget about the incremental backup features of regular old tar(1).

  11. Re:SkyDrive by Zemran · · Score: 4, Insightful

    As you say, the internet is really crap at times when you are travelling so why make life difficult? It is also fair to say that you obviously think of travelling as a bit of wandering around in the US. Once you broaden your horizons you will find that the internet is often not even an option.

    Skydrive is not going to integrate with Ubuntu (have you read the summary yet?) so it is a stupid option whereas there is a dropbox client. It is still flakey and not going to be easy to use as required so he is still better off doing something that will work well and therefore get done regularly. If he is using some client for a service that sometimes works and sometimes doesn't you can guarantee that the time when he needs that backup will be one of the times that it did not work.

    --
    I love stacking my barbecues in the shed at the end of summer - you can't beat a bit of grill on grill action.
  12. YOU DONT HAVE A BACKUP - FOOL by Anonymous Coward · · Score: 0

    If all you are doing is copying files from laptop to your USB HD.
    Then prepare to be shattered.

    A work college who did exactly the same as you, Went to restore some files that he removed previously (Space issue) learnt the hard way.
    Came to work and asked - How can I recover files from my HD? I can still open them from the HD but the images are all corrupt....

    My advice was ALWAYS have 3 (THREE) copies of any important data.
    1) Live (Laptop)
    2) First backup
    3) Second backup for when you first backup FAILS while trying to restore the first.

    Full backups are best. Move the backup off site (Even in the back shed with an airtight sealed container).

    1. Re:YOU DONT HAVE A BACKUP - FOOL by Anonymous Coward · · Score: 0

      Wouldn't hurt to use something like QuickPar to create Reed-Solomon recovery files too so that you can actually recover corrupted files.

  13. Finally! An interesting question. by colonel · · Score: 5, Insightful

    First, ignore the people who encourage you not to try, and who point you in other directions. Sure, there are much better ways of doing this, but who cares? The whole point is that you should be able to do whatever you want -- and actually doing this is going to leave you _so_ much smarter, trust me.

    Some douche criticized you for not knowing beforehand why hard links wouldn't work. . . . because, you know, you should have been born knowing everything about filesystems. To hell with him, sally forth on your journey of discovery, this can be hella fun and you'll get an awesome feeling of accomplishment.

    First off, you're going to have trouble using rsync with the flash drive, because I assume your constraint is that you can't fit everything on the flash drive, it's only big enough to hold the differences.

    Next, come to terms with the fact that you'll need to do some shell scripting. Maybe more than just some, maybe a lot, but you can do it.

    I'd recommend cutting your hard drive in two -- through partitions or whatever -- to make sure that "system" is fully segmented from "data." No sense wasting all your time and effort getting backups of /proc/ and /dev/, or, hell, even /bin/ and /usr/. Those things aren't supposed to change all that much, so get your backups of /home/ and /var/ and /etc/ working first. Running system updates on the road is rarely worth it, and will be the least of your concerns if you end up needing to recover.

    Next, remind yourself how rsync was originally intended to work at a high level. It takes checksums of chunks of files to see which chunks have changed, and only transfers the changed chunks over the wire in order to minimize network use. Only over time did it evolve to take on more tasks -- but you're not using it for its intended purpose to begin with, since you're not using any network here. So rsync might not have to be your solution while travelling unless you start rsyncing to a personal cloud or something -- but its first principles are definitely a help as you come up with your own design.

    The premise is that, while travelling, you need to know exactly what files have changed since your last full backup, and you need to store those changes on the flash drive so that you can apply the changes to a system restored from the full backup you left at home. You won't be able to do a full restore while in the field, and you won't be able to roll back mistakes made without going home, but I don't think either of those constraints would surprise you too much, you likely came to terms with them already.

    So, when doing the full backup at home, also store a full path/file listing with file timestamps and MD5 or CRC or TLA checksums either on your laptop or on the flash disk, preferably both.

    Then, when running a "backup" in the field, have your shell script generate that same report again, and compare it against the report you made with the last full backup. If the script detects a new file, it should copy that file to the flash disk. If the script detects a changed timestamp, or a changed checksum, it should also copy over the file. When storing files on the flash disk, the script should create directories as necessary to preserve paths of changed/new files.

    For bonus points, if the script detects a deleted file, it should add it to a list of files to be deleted. For extra bonus points, it should store file permissions and ownerships in its logfiles as replayable commands.

    The script would do a terrible job at being "efficient" for renamed files, but same is true for rsync, so whatevs.

    I built a very similar set of scripts for managing VMWare master disk images and diff files about ten years ago, and it took me two 7hr days of scripting/testing/documenting -- this should be a similar effort for a 10-yr-younger me. I learned *so* much in doing that back then that I'm jealous of the fun that you'll have in doing this.

    Of course, document the hell out of your work. Post it on sourceforge or something, GPL it, put it on your resume.

  14. The right tool for the task by grumpy_old_grandpa · · Score: 1

    It seems like the poster confuses two tasks: Backup and version control.

    For the former, use archiving tools to perform full and incremental backup. How is it done? You could use find to list files with certain criteria, e.g. last modified timestamps. Pass that list to using the -T flag, where you also use -X to exclude files and directories like "*/.thumbnails" and "*/.[cC]ache*". Once the tar is done, use your favourite checksum tool; md5sum, shasum to store a checksum of the archive in a separate file. Once you get home, move the archives, verify the checksums, and you're done.

    As pointed out in the summary, deleted directories and files will be an issue, thus, you perform full back from time to time. The time frame will depend on how big the changes are, and how much data you have. Personally, I've settled on every second week for /home, but that does not include huge files like RAW files from a DSLR.

    As for version control, set up your own git repository with git init, copy it to the laptop with git clone, and you're ready to go. Pro tip: Make sure you name your home computer with a real or "fake" DNS (e.g. in /etc/hosts, or ~/ssh/config). You can then simply refer to it has "home" where ever you are, and tools like git and svn stay happy.

  15. dar? by safetyinnumbers · · Score: 3, Informative

    If I understand your problem right, How about dar? It can make an empty archive of your main backup to act as a reference (just file info, no files). Then it makes archives relative to that, with just changed files. It can then apply the changes to the original dir, including deletions, if you need that.

    1. Re:dar? by jchevali · · Score: 1

      I agree, dar is definitely the way to go. You need to learn how it works but once you do it's incredible all the things you can do. What safetyinnumbers is referring to is called an isolated catalogue. See also: dar_manager.

    2. Re:dar? by Anonymous Coward · · Score: 0

      dar (the submitter probably wants kdar) has too few bugs and is too easy to use for most people. Hence they won't know about it, use it, or recommend it.

  16. Lion does this automatically... by Anonymous Coward · · Score: 0

    Local backups via TimeMachine when your laptop is not connected to the backup disk.

    1. Re:Lion does this automatically... by Anonymous Coward · · Score: 0

      Yeah, except that it only works with a single TimeMachine target (you can't sync to multiple TimeMachines) and doesn't "just work" with a USB key - you need a Mac Mini Server with the TimeMachine service turned on and an external hard disk, an AirPort with TimeMachine support and an external hard disk, or an external hard disk that you initialize to be a TimeCapsule (and nothing else). At least you get a CoverFlow browser for restoring files.

    2. Re:Lion does this automatically... by spire3661 · · Score: 1

      Im running a Time Machine backup on my Synology NAS. You can also easily pop a FREENAS VM and time machine backup that way too (make sure it has netatalk 2.2+). The only apple equipment you need to Time Machine is the computer you want ot backup. I would also like to point out you can full sync to multiple Time Machines by selecting a different TM volume. I backup to the NAS hourly and I also do a Time Machine backup to a local USB drive quarterly.

      --
      Good-bye
  17. Re:Finally! An interesting question. by colonel · · Score: 4, Insightful

    Forgot to mention:

    To accomplish this, you'll need to read up on:
    - bash
    - find
    - grep
    - awk
    - sed
    - md5sum
    - chmod/chown
    - mkdir -p
    - diff/patch (for general reference, and also look up binary diffing tools)

    Extra extra extra bonus points if you compress the changed files when storing them on the flash drive.

  18. Re:SkyDrive by Anonymous Coward · · Score: 1, Informative

    Did you read the summary?

    Did you read his history.

    Partofme is another of the Bonch/Sharklaser/Tech* etc etc sockpuppet team.

    They're a group of Burson-Marsteller reputation managers working for Microsoft. They always get early postings so they can divert discussion to their pro-MS agenda.

  19. man rsync --link-dest, --relative, --exclude... by Anonymous Coward · · Score: 0

    If you want to stick with rsync for backups, what you want to do is get beyond having just a mirror on the external drive. After all, a backup should help you recover from mistakes, and mirroring will replicate your mistakes to the external drive too.

    Instead, keep a series of backup snapshots on the external drive, representing your data at a certain point in time. Each rsync pass creates a new snapshot, like /mnt/backup/2012-05-20/ which represents your internal drive and shares common files by hardlink with older snapshots such as /mnt/backup/2012-05-19/ but doesn't have links to things that were deleted. Merging backups between two different external devices is then a matter of transferring around whichever dated snapshots you want to mirror or migrate between devices.

    Here's a hint about how to implement one such snapshot:

    mkdir /mnt/backup/2012-05-20
    rsync -Ravx --link-dest=/mnt/backup/2012-05-19/. --exclude=/var/{tmp,cache} --exclude=/tmp /. /mnt/backup/2012-05-20/.

    see the man page for more details, and the general inductive step is left as an exercise to the reader. In practice, this sort of backup has very little overhead for snapshots of non-changing files. I allocate approximately 150% of my source data volume for my backup volume to maintain a long-term history of many daily, weekly, and monthly backups. My script decimates older backups (with rm -rf /mnt/backup/YYYY-MM-DD) to turn a series of dailies into weeklies, weeklies into monthlies, etc.

    The pathological case for this kind of backup is a huge file that slowly grows, such as /var/log/btmp on older Linux systems where logrotate did not rotate that file. An optimization for rotated logs is to make sure they get a name like basename.YYYY-MM-DD instead of basename.1, so that the name of older files doesn't change each time it rotates. Also use appropriate exclude patterns so you don't waste time and space backing up junk you don't need. You can even go the other way and only selectively retain stuff like:

    rsync -Ravx --link-dest=/mnt/backup/2012-05-19/. /./etc /./boot /./home /./var/log /mnt/backup/2012-05-20/.

    This is an example of the power of the -R (--relative) naming scheme understood by rsync. The position of the extra "." inside the source file paths is not a typo, but actually essential to the purpose of this example. Learn it. Live it. Love it.

    1. Re:man rsync --link-dest, --relative, --exclude... by Anonymous Coward · · Score: 0

      For people not wanting to write their own script to do what you explained above: dirvish

    2. Re:man rsync --link-dest, --relative, --exclude... by buchanmilne · · Score: 1

      Or rsnapshot

    3. Re:man rsync --link-dest, --relative, --exclude... by scoobertron · · Score: 1

      This is tangential, but I had a big snafu when using --link-dest. Which was largely due to my use-case, but I like to mention it on threads like this in case it saves someone some hassle. Link-dest seems to work by creating the directory structure and then populating it with hard links and changed files. This takes time and if you interrupt it, you wind up with a lot of empty directories. If you then use this as the model for your next backup, the number of changes is huge and this will take a lot of time. If you have an automatic script that backups over ssh (say) and you tend to use your laptop for short periods (say), you can end up with a lot of incomplete backups. If you then (say) delete the partition that your OS is on while you are using it, things can go badly for you. Nowadays, I use rsync to update a single mirror of the filesystem, and then snapshot this periodically on the server using cp -l.

    4. Re:man rsync --link-dest, --relative, --exclude... by Medievalist · · Score: 1
    5. Re:man rsync --link-dest, --relative, --exclude... by GPLHost-Thomas · · Score: 1

      I second you on dirvish, this is an excellent software, which we use a lot.

  20. support.marsupials.info? by macraig · · Score: 1

    They'd have the skinny on pouches for sure.

  21. Re:SkyDrive by partofme · · Score: 5, Insightful

    Actually, I'm not even US citizen, and I travel in South East Asia. When talking about shitty internet, I know what shitty internet is. For example when I'm staying in Cambodia, internet can (and often does) go down for the whole day and night. It also happens often. The speed is also ridiculously slow. You can try to get around some of the downtimes by getting mobile internet for backup, but if there's a wider outage, there's nothing you can do.

    Yet, I've found Dropbox to be the best backup solution. Files will get there eventually, and I don't need to do anything. There's also revision history of files, so if you upload corrupted files or something like that you can reverse it. You can access them from other computers in case your laptop goes poof (happened to me). And the most important thing - if you get robbed or lose your luggage, you will still have access to your files (and of course, I keep my laptop encrypted).

    The good sides of online cloud backup far outweights the negative ones or worries about bandwidth. Especially since most of the time the files that need backup aren't large. No one in their right mind would try to sync their media files.

  22. git-annex by Anonymous Coward · · Score: 0

    I have not used it myself, but I belive that git-annex does exactly what the OP asks for: http://git-annex.branchable.com/

    1. Re:git-annex by Weezul · · Score: 1

      Yes, git-annex could be coaxed into doing this, but it's not completely trivial.

      --
      The Christian religion has been and still is the principal enemy of moral progress in the world. -- Bertrand Russell
  23. And when you're done reinventing the wheel... by outsider007 · · Score: 1, Offtopic

    You can get started on fire.

    --
    If you mod me down the terrorists will have won
  24. simple solution by Anonymous Coward · · Score: 0

    To detect the changes, you can utilise snapshotting (rsnapshot package perhaps?) to do it and it would allow you to see the changes from a day-to-day view.

    All you need to then do is transfer the changes listed until the daily.1 (or appropriate folder) to your USB stick. It maintains paths, which is one of the items you're after.

    As for deletions, I think a daily email of the snapshot.log file could list this information for you. I wouldn't want it more complicated than that I guess...
    Hope this helps,
    @chayharley

  25. Re:SkyDrive by Capt.+Skinny · · Score: 1, Insightful

    The good sides of online cloud backup far outweights the negative ones

    Until your cloud backup provider goes out of business or stops offering the service. You think rsync is a lot of work? Try keeping current on the status of Dropbox and SkyDrive services so you can pull your data before they disappear. I guarantee you that a properly stored external drive will outlive either of them.

    Oh, and if you were trolling with that first post, kudos on playing it out so long.

  26. using touch find + tar by Anonymous Coward · · Score: 0

    timestamps.

    could you:
    store the timestamp of latest backup, using touch filename.
    run find with -newer timestampfile as one of the params, can't remember others.
    pipe output to tar.

    http://dbaspot.com/shell/399852-creating-tar-file-only-files-have-changed-since-specified-date.html

  27. Comment removed by account_deleted · · Score: 2

    Comment removed based on user account deletion

  28. Install Windows by Anonymous Coward · · Score: 0

    Install Windows, use a briefcase

  29. Mod down to -3 by Anonymous Coward · · Score: 0

    Windows hard links do not span volumes, you are probably thinking of junctions. See:

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa365006(v=vs.85).aspx

  30. Re:Finally! An interesting question. by Anonymous Coward · · Score: 0

    Best post!

  31. Re:SkyDrive by Lord+Crc · · Score: 5, Informative

    Obviously Skydrive is of no use but there are several other alternatives that would be better suited to this purpose although if, as he says, it is for use while travelling an internet based system is useless.

    That's why I liked Crashplan when i first saw it. This may sound like a sales pitch but I'm just a happy customer.

    With Crashplan you can have multiple destinations for your backup set. I usually have three:
    - same HD in case I accidentally deleted some files.
    - USB HD for faster recovery in case my primary HD breaks.
    - Online "in the cloud", in case my house burns down etc.

    Crashplan detects when I plug in the USB HD and automatically starts running updating the backup on it. If there's no internet the first two destinations will still keep me pretty safe. Once the internet is back it catches up on the cloud destination.

    It works just fine on my Linux Mint laptop as well as my Windows desktop pc.

  32. Re:Finally! An interesting question. by philip.paradis · · Score: 2

    Or he could save himself a ton of grief and just use rdiff-backup, which happens to use librsync, produces incremental differential backups, stores said backups as files you can simply browse, works equally well on local and remote filesystems, and is dead simple to use. I've used it for years now on a ton of systems.

    --
    Write failed: Broken pipe
  33. Re:SkyDrive by partofme · · Score: 3, Insightful

    Try keeping current on the status of Dropbox and SkyDrive services so you can pull your data before they disappear.

    Email? Twitter? Facebook? All kind of "push notification" technologies where you don't really need to do anything if you use them.

    Besides, we are talking about Microsoft here. A company that has ridiculously long phase outs for their products as a standard practice so businesses feel safe using them (seriously, they announced that a version 4.0 of SilverLight will see end of support in two years from now). If there is any tech company in the world that you can trust not just going to end support suddenly, it's Microsoft.

  34. Re:Finally! An interesting question. by hankwang · · Score: 1
    If you go for a system where the files are stored in a Unix-like filesystem (case-sensitive filenames, permissions), what kind of filesystem would you need to use on the USB stick? I believe that the wear-leveling system on USB sticks and flash cards is optimized for FAT filesystems (with the file allocation table right at the beginning). I think that a journalling filesystem would be a good idea on a flash drive, which leaves you with ext2 (with noatime) and very long filesystem checks every time you accidentally pull out the USB stick without unmounting.

    With backup drives and file transfers, I also tend to run into the problem that I have different UIDs on different systems. Maybe not such a problem for the OP, but you mention backups of /var which is typically full of files owned by system users (e.g. cups, and mysqld/apache if you use the laptop for web development).

  35. Re:SkyDrive by Anonymous Coward · · Score: 1

    Wait a minute, I thought they were working for Apple. Oh I'm so confused.

  36. Re:Finally! An interesting question. by Anonymous Coward · · Score: 0

    Sweet post. Yes indeed you get full five points for reading comprehension and reading between the lines. And of course for great advice. Have been AC on /. since a couple of months after it started, so no problem ignoring the inevitable chaff.

    I'm just rather baffled that what I'm looking for isn't already done; figure I must be blind. And at 50 I'm getting slow and less interested in skinning the cat myself. But if it comes to that (we'll see how the thread looks like by morning) then now I've got great advice for the next step. Thank you so much.

  37. LuckyBackup or BackInTime + an online sync service by Sosarian+Avatar · · Score: 1

    I don't know if I'm one of the "smart kids" or not, but I'm a standard non-technical user and have found LuckyBackup or BackInTime run along with an online sync/backup service like DropBox or SpiderOak the most handy options.

    Both LuckyBackup & BackInTime are GUI tools that set up rsync rules (even complicated ones) with an easy point-and-click interface, then schedule them in cron. They can do anything rsync can: synchronize the drives so the backup matches the current, or make a backup of everything present plus never delete anything, and they won't waste time/energy by backing up files that haven't changed;

    LuckyBackup can be set to keep up to 99 snapshots of anything that changes, and they're structured in the exact same way as the original. BackInTime can have unlimited snapshots, and each backup is in a different nested folder by date/time, with unchanged files within each folder being soft links back to the most recent backup copy. Both programs just create file copies, not compressed archives.

    Right now, I'm using LuckyBackup for my regular files, and I have BackInTime handling my writing directory so I can go back to an unlimited extent in case -- as happened once -- I realize that I had made a major change several months ago (more backup dates than LuckyBackup tolerates in snapshots) that turned out to be a horrible mistake, so I don't have to try to reconstruct the original from memory.

    I use the web/online backup solution partly to keep my computers in sync without a thumbdrive. It's also because it acts as a free minute-by-minute backup with a few months of snapshots, so if an .odt file becomes corrupt while I'm working on it, I don't lose everything since the previous system backup. I lost about 30 hours of intense revisions a couple of years ago because the thumbdrive I was saving & transporting my files on had a glitch that evidently had messed up everything I'd been saving for a few days -- and as it turns out, it's not possible to extract text from a bad .odt file even with a hex editor.

    --
    Apathy Sucks, Nobody for President!
  38. Re:Finally! An interesting question. by hankwang · · Score: 1

    Or he could save himself a ton of grief and just use rdiff-backup,

    Interesting, since I used rdiff-backup in the past and found it a pain. If files are stored as diffs of diffs of diffs of diffs of a full copy, it is rather easy to corrupt the backup. These days, I make backups using rsync, with

    rsync -aOi --delete --modify-window 1 --link-target /mnt/backup/home-20120519 /home /mnt/backup/home-20120520

    For the first backup, omit the --link-target argument. Only modified files are stored. As long as you don't have tons of big files that have only a few bytes changed, I don't see the advantage of rdiff-backup. However, it requires that the backup filesystem supports hard links (see my other comment on the use of a unix filesystem on a flash drive). When you come back home, you can do something similar (with --delete) to sync back to your regular backup drive.

    The modify-window option is there to because I have to backup Windows filesystems as well.

  39. Re:Finally! An interesting question. by hankwang · · Score: 1

    Replying to myself: of course, I realize that the OP cannot use a hard-link backup if the usb drive cannot hold all his important data. It's too long ago that I used rdiff-backup; can you reliably split the master backup and the differential backups to different filesystems (say the drive at home and the usb stick)? Preferably without risking corrupted backups if it involves manually merging diff trees.

  40. does this need to be so complicated? by egork · · Score: 2

    From what I have parsed the OP wants to have a full back-up on a USB-HDD and the diffs on the USB-Flash, because the Flash is limited in size.
    Just write two rsync (or grsync) scenarios: one for HDD and the other for the Flash. On the HDD you will have a directory that is a mirror copy of your laptop. On the Flash you will keep the diffs for the time between syncs to the HDD.

    When at home
    1. rsync your laptop to the HDD (mirror).
    2. copy the incremental stuff from the Flash to a separate directory (e.g. diff-2012-May-21) on the HDD, and wipe the Flash.

    At the road:
    just rsync diffs to that Flash.

    I guess the recovery plan is quite obvious too. Should any _one_ of those three devices die, you are still good to go.

    1. Re:does this need to be so complicated? by Anonymous Coward · · Score: 0

      Yes, it does. Because what are you going to diff against when you don't have the external HDD?

    2. Re:does this need to be so complicated? by egork · · Score: 1

      OK, I got it, so the diff is the problem.
      I see two solutions
      1. write the date of the latest mirror-sync to a file in laptop and copy all newer or modified files to flash with a "find".
      2. have a second copy (mirror) on a separate partition the laptop HDD and diff against it. Actually helpful in case you really need to restore a (deleted) file while on the road.

      I believe having a complicated script and set up is more "expensive" at the end of the day as just to have a second (or a third copy).

  41. rsync handles deletes just fine by Anonymous Coward · · Score: 0

    Look at the --delete option of rsync.

  42. unison is bi-directional by Gunstick · · Score: 1

    unison has already been suggested multiple times.

    I used unison. It's perfect to sync from A to B (it only syncs the diffs) then modify B and later sync B to A
    You also can modify A and B at the same time as long as it's not the same file, then sync and then A and B are identical.
    You can even sync in cycles: A->B->C->A with modifications on all three directory trees and it still works
    Unison also handles deletions on both sides fine.
    Hint: use the -group -owner -times flags

    --
    Atari rules... ermm... ruled.
  43. dump, snapshots, rsync batch mode by dtdmrr · · Score: 1

    The first problem to consider is how you determine which files to backup. Filesystems like xfs, zfs, and btrfs have nice convenient ways to get a list of changed files (and for xfs and zfs, the contents of those files as well). For ext2/3/4 (and other older unixy filesystems) look at "dump". And of course, if you're working with a completely dumb filesystem, you can always use rsync (if your backup disk is remotely accessible) or some external/manual indexing to figure out what files to backup.

    If your filesystem supports some form of dump (send for zfs), you can use that to create your incremental changes. If you only have a list of files, use tar, or rsync. If you have want to keep a full backup on the same drive, you can use rsync's batch mode (see the manpage) to efficiently generate incrememental backups, for filesystems that don't do a good job of that.

    You don't want to hard link between your live tree and a backup tree. That will result in the changes showing up in both trees, obscuring the changes when you run a backup. It's a technique used with rsync for snapshotting, where two backups trees represent the state of the original filesystem at different times. To make that work, the links are broken for the files that differ between the two snapshots.

  44. Re:Finally! An interesting question. by e70838 · · Score: 1

    Or learn Perl. Perl can do easily the same things as bash, find, grep, awk, sed, ...

    Avoiding to learn all the intricacy of all these tools was one of the main purposes of Perl.

  45. MacBak by Anonymous Coward · · Score: 0

    Try MacBak works on Ubuntu as well :

    https://github.com/daemonza/MacBak

  46. Re:YOUR MOM'S POUCH! by DarwinSurvivor · · Score: 2

    No, he's made part of his username into a fake uid to make it look like he's been here longer. (hint: the second one is his uid).

  47. rsync by gatzke · · Score: 1

    For years I have used rsync scripts.

    My problem was syncing a desktop and a laptop. So I made upload_to and download_from scripts to sync as needed.

    I also try to keep a third master backup copy on a different server so all three are synced.

    One problem comes when trying to work on both desktop and laptop simultaneously. Just map a drive and modify files on one side.

  48. git by phorwich · · Score: 1

    I think git has got what you seek. http://git-scm.com/

    --
    Wait. Stop scrolling for a sec. O.K. Thanks. - P
  49. Robocopy by Anonymous Coward · · Score: 0

    You could set up a robocopy script to do incremental backups. Then when you run it just set the 'edited after' property to only backup files since your last home backup. There are plenty of templates for this online as well as a GUI application if you prefer it.

  50. Re:SkyDrive by Anonymous Coward · · Score: 1

    Not to rain on your "old paranoid guy" parade, but dropbox (and I assume most others are too) IS local storage (sync'd to the cloud)...They go out of business, just uninstall, and install the next one. Probably works exactly the same.

  51. ZFS by Carl+Drougge · · Score: 1

    In the grand internet tradition of answering a loosely related question which is no use at all to the asker, I will say that the "smart kids" might use something like ZFS, which almost handles this for you. (Take snapshots, save delta streams on your USB stick. Requires the backup to be a ZFS copy, not just the same files.)

    Useless right now at least. But I've been pretty happy with switching my storage to ZFS, even if the Linux version sucks. (I mostly don't use the Linux version.) I'd recommend it to anyone who doesn't mind a bit of transitional pain.

    1. Re:ZFS by MightyYar · · Score: 1

      That's a terrific idea, and it would be a much cleaner and more reliable solution than some kind of cobbled script. Maybe he could make his working directory on Linux a ZFS volume using FUSE. Snapshot it before you go on the road, export the snapshot to the external HDD, and then periodically export the snapshot delta to the USB as a backup. When you get home, re-snapshot to the external HDD and delete the delta on the USB. The snapshot creation/destruction and export could (and probably should) be automated. Similarly, the delta export could be automated.

      Recovery would be a cinch - when you get home, import the snapshot from the external HDD and then import the delta from the USB.

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
  52. tar by bWareiWare.co.uk · · Score: 1

    Easiest solution is probably to use tar's incremental backups. The -g argument creates a relatively small file listing the files already backed up, so future incremental runs can skip them. If you keep the incremental files on the laptop then you can put each days actual tar backup on whatever devices you have handy.

    1. Re:tar by Anonymous Coward · · Score: 0

      This is the answer.

      Here I'm backing up my data/ directory.

              tar czvf backup/main.tgz -g backup/main.inc data/

      Now I copy main.inc (which is a listing of all files that were backed up and their dates) to my flash drive:

              cp backup/main.inc usb/main.inc

      I've changed some files in data/ now, and I want to back it up now. Except I don't have access to backup/ right now, and usb/ isn't big enough to hold a full backup. I make a copy of the main.inc file to go with the new backup, and then make the backup.

              cp usb/main.inc usb/diff.inc
              tar czvf usb/diff.tgz -g usb/diff.inc data/

  53. Re:Finally! An interesting question. by Anonymous Coward · · Score: 1

    Back in 1993 when I was new to *NIX, I asked a seasoned sysadmin which scripting language I should learn. He started listing all those same tools .... then said - "or you could just learn perl."

    I did and you sir are 100% correct. I know grep, find, ksh/sh, sed very well - my awk is extremely weak. Perl hasn't let me down all these years. It is still my go-to scripting language whether I'm hacking some crap code together OR performing a system design and pushing out a beautiful website with XML or json services (check out Perl-Dancer) in a few hours.

    Perl can be written cross platform - damn you Windows file systems - with a little effort. I'm constantly hacking Windows Perl scripts using strawberry perl.

  54. Buy a bigger flash drive! 64GB isn't too expensiv by Anonymous Coward · · Score: 0

    Buy a bigger flash drive! 64GB isn't too expensive.
    If you are running Linux, then 64G should easily handle your OS and documents with many versions.

    It is only video, audio and photos that will eat up lots of storage and you need to get those to a server in a different country ASAP anyway. Use rsync+ssh to do that for the big files.

    I saw a 32G USB flash drive for $17 yesterday. Unless you are storing HiDef video, this should cover a few weeks overseas. Be certain to encrypt it AND your laptop, but leave a tiny OS that boots so you can show it to customs and border control.

    Do not carry your passphrases with you. Keep the KeePassX data file in the cloud somewhere ... so it isn't on the machine at boarder crossings. You will not physically be able to decrypt the HDD this way.

  55. I might be crazy by Mr0bvious · · Score: 1

    and I know this is not what he asked for, but wouldn't the simplest solution be to purchase a second external drive (maybe an SSD for durability) and actually have a complete backup on the road... Or even just take his current external with him - he has it backed up in the cloud any way...

    I ask because he never stated why that external drive was stuck at home..

    If that won't do, another possible solution.

    1) I don't see a need to sync the USB stick when he returns - just perform your usual backup when you return and only care about the USB stick if it you have a failure before returning home.

    If (1) is workable for him then: 2) how much data will he really need to backup when out-and-about? Can't you setup an 'away from home' backup profile that will only backup the things you'll be changing while away - document, current working folders, but skip the movies, porn and music for this backup (it's still at home and in the cloud anyway)..

    Since he expects the deltas to fit on a USB stick, I'm assuming he's not wanting to backup a heap of video editing or some other hungry activity...

    --
    Never happened. True story.
    1. Re:I might be crazy by fuzzywig · · Score: 1

      I'm guessing the OP isn't taking the external HDD with him because it's something else to carry and/or loose, and it's also his backup drive.
      Having a backup of your laptop isn't going to help in a lot of situations if you keep the backup in the same bag as the laptop.

    2. Re:I might be crazy by Mr0bvious · · Score: 1

      I'm guessing the OP isn't taking the external HDD with him because it's something else to carry and/or loose

      But he's taking a USB flash drive anyway - it's not that different.

      and it's also his backup drive.

      He could purchase another as I suggested - they're not exactly prohibitively expensive.

      Having a backup of your laptop isn't going to help in a lot of situations if you keep the backup in the same bag as the laptop.

      It doesn't need to be stored in his laptop bag, and let's not forget his main backup is sill in the cloud...

      --
      Never happened. True story.
  56. What about Git? by XanthusMaximus · · Score: 1

    Just do a clone with Git. You can track changes, deletions and it can resolve conflicts easily.

  57. Re:SkyDrive by comp.sci · · Score: 3, Insightful

    For 99.9% of all users a backup is simply that, a failsafe in case their main HD gets lost / damaged. So what if dropbox or skydrive suddenly were to go out of business (as unlikely as that is, youd know in advance)? You suddenly lose access to that safety copy of your data and will know right away because the client cannot connect anymore. But you still have your primary copy of everything, nothing was lost, you can just switch providers or change your backup strategy. The chances that something would happen right then in the time-frame that the cloud provider fails and you make another copy with another provider are incredibly low. If you can't take that risk then you'd have a third backup anyways.

  58. Us a watch program by foniksonik · · Score: 1

    Thete are multiple "watch" apps out there in various languages that will run a script every time a directory changes.

    Google "watching files with ruby"

    Substitute ruby for python or perl or...

    --
    A fool throws a stone into a well and a thousand sages can not remove it.
  59. Its easy by Anonymous Coward · · Score: 0

    if ilusb | grep
    then
    backup script
    fi

    and so on

    This is how my backup script works I do incremental backups to an external usb hdd if it is connected and just create local restore points if it is not.

  60. Re:SkyDrive by PRMan · · Score: 1

    Yes. All of my media from Microsoft still PlaysForSure.

    --
    Peter predicted that you would "deliberately forget" creation 2000 years ago...
  61. Re:SkyDrive by shellster_dude · · Score: 1

    I second the CrashPlan option. I've done the manual backing up to HDD's and USB Drives, but that way leads to madness.

  62. Re:SkyDrive by Anonymous Coward · · Score: 0

    If there is any tech company in the world that you can trust not just going to end support suddenly, it's Microsoft.

    Kin?

  63. Git and Super Flexible File Synchronizer by rvelasquez · · Score: 1

    Someone had suggested using Git and I was going to suggest the same. If you are only backing up documents then it should be easy enough to create repos on the USB HDD, Laptop and USB drive. You can then commit/merge changes between repos to keep in sync, perhaps use some shell scripts to ease administration. Also, I use a product called Super Flexible File Synchronizer to sync a subfolder on my laptop's filesystem with a WebDAV server. It's got lots of features and supports Linux, Windows and Mac. http://www.superflexible.com/

  64. Re:SkyDrive by Wovel · · Score: 1

    Except their hosting of Windows 7 Widgets. Already gone except for the top 10.

  65. Re:Finally! An interesting question. by Anonymous Coward · · Score: 0

    Agreed. If you wade into this you're going to want to use Perl.

    I wrote pretty much exactly this about 15 years ago in OS/2 REXX of all things. Trying to use system tools will end up being way too slow; you're going to want to use an in-memory hash. REXX supported hashes before they were called hashes. (indirect array references, I think? can bash do that?)

    If you do write this, please do share it somewhere.

  66. unionfs by nblender · · Score: 1

    Since you can't use dump(8) as others have pointed out, maybe you can do something with UnionFS. After you do your full backup to USB HDD and are about to leave on a trip, mount a unionfs over top of your critical filesystem(s)... Then every day, copy the union layer off to thumb-drive.

  67. Re:SkyDrive by Anonymous Coward · · Score: 0

    Yeah, Crashplan sounds nice, but...

    Backup software written in Java, and you have to run it all the time? What a horrible resource hog.

    Blowfish encryption with no option for AES? What a strange decision.

    These are worryingly bad design choices which don't bode well for data recovery.

  68. Re:SkyDrive by MightyYar · · Score: 2

    Try keeping current on the status of Dropbox and SkyDrive services so you can pull your data before they disappear.

    You clearly have never used DropBox. It's just a shared folder that populates on every computer you install it on. If DropBox were to die right this instant, you would still have all of your data on every one of your computers - it would just stop syncing.

    If you are worried about the revision history, you could pick one computer to run a rsync job between the DropBox folder and another folder of your choice, or if you are on a Mac just use TimeMachine, or if you are on Windows run something like Areca backup or any number of other free incremental backup solutions. You should be doing this anyway.

    Then when DropBox goes out of business, you can switch to one of the several competitors out there and continue as before.

    --
    W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
  69. Re:SkyDrive by MightyYar · · Score: 1

    I'll take this one: Apple is just a puppet through which the will of Google is manifested. Even... though... Google is... much... smaller than... Apple... or something.

    --
    W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
  70. Re:Finally! An interesting question. by colonel · · Score: 1

    Or you can learn all the utilities if you want to learn right and be a better sysadmin and work with other sysadmins.

    Perl is for programmers that like to pretend they know how to be sysadmins and don't need to share their tools with other sysadmins.

  71. Re:Finally! An interesting question. by colonel · · Score: 1

    If you want to "copy" junk with its metajunk from an ext3 filesystem on to a FAT32 filesystem, remember that you can always create an 8GB file with dd from /dev/zero, run mkfs.ext3 against that file, and then mount that file as an ext3 filesystem thanks to the loopback adapter. You won't be able to read that junk from a Windows machine, but you probably won't care, and if you create an 8GB file on a 16GB FAT32 flash disk, you'll still have 8GB of space available for use in Windows -- and Windows will be able to copy the 8GB filesystem file and stuff.

    Someone else's explanation: http://nst.sourceforge.net/nst/docs/user/ch04s04.html

  72. Re:SkyDrive by MightyYar · · Score: 1

    I would also like to second Crashplan. Mozy broke my cloud backup cherry, and Crashplan has been completely problem-free for me. I run it on every computers that I own and backup to the "cloud" as well as to my basement server. They have a great feature where you can send them a hard drive to seed your initial backup so that it doesn't take a month to do your initial backup.

    Another thing that I do is install it on family and friend's computers whenever they ask me to fix them. I just point it to my basement server. That way when their hard drive crashes (and it always does - especially on laptops), it makes my life much easier. It uses some of my drive space, but even post-Thailand-flooding hard drives are pretty cheap relative to time.

    --
    W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
  73. Autorun by Khyber · · Score: 1

    I know people hate it, but setting up an auto-running batch script for backup upon plug-in. I've had no issues doing this from Windows to Linux.

    --
    Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
  74. Re:SkyDrive by fuzzywig · · Score: 1

    There's shitty internet, and there's no internet. OP may be heading for the latter?

  75. Bitpocket? Unison? by dwheeler · · Score: 1
    --
    - David A. Wheeler (see my Secure Programming HOWTO)
  76. incremental tar by Anonymous Coward · · Score: 0

    Isn't incremental tar just made for that ?
    http://www.gnu.org/software/tar/manual/html_node/Incremental-Dumps.html

  77. Re:Finally! An interesting question. by Anonymous Coward · · Score: 0

    Thems fightin words. Perl is for everyone.

  78. Re:YOUR MOM'S POUCH! by Endo13 · · Score: 1

    His account is obviously to troll the real kdawson, whose UID is 3715.

    --
    There is no -1 Disagree mod. Slashdot.org/faq defines mod options. USE IT.
  79. Re:SkyDrive by mikestew · · Score: 1

    Besides, we are talking about Microsoft here. A company that has ridiculously long phase outs for their products as a standard practice so businesses feel safe using them (snip) If there is any tech company in the world that you can trust not just going to end support suddenly, it's Microsoft.

    "End support suddenly" is pretty much what they did with Office Live Small Business. A couple of emails of warning, then in about two weeks (maybe a month) the plug was pulled. No migration plan to move to Office 365. Oh, MSFT suggested moving to Office 365, but one would just have to start over. That's just one, personal example of a Microsoft business product that I have experience with (and I'm not too broken-hearted, other than the hassle, as their offering kind of sucked). Consumer-level products? Examples abound both from personal experience (PlaysForSure and MSN Music pop right to mind) and those of others on why you don't want to put too many eggs in the Microsoft basket.

    MSFT probably won't be ending support for Windows or Office, but I'd be wary of trusting them with anything else.

  80. Re:SkyDrive by spire3661 · · Score: 1

    Any data that is 'on the cloud' should not be the only residence for that data. If you store your only copy of data that you care about in the cloud, you're an idiot

    --
    Good-bye
  81. Easy script to grab changed files into an archive by dlakelan · · Score: 1

    find . -newer last_backup_timestamp | cpio -o snapshot$(date +%Y%m%d) && touch last_backup_timestamp

    --
    ((lambda (x) (x x)) (lambda (x) (x x))) http://www.endpointcomputing.com a scientific approach to custom computing.
  82. Re:Finally! An interesting question. by DrVxD · · Score: 1

    Extra extra extra bonus points if you compress the changed files when storing them on the flash drive.

    Hint for the bonus question: gzip ;)

    --
    Not everything that can be measured matters; Not everything that matters can be measured.
  83. Re:Finally! An interesting question. by Anonymous Coward · · Score: 0

    This is the only readworthy comment in this whole thread. Thank you for posting this!

  84. Re:SkyDrive by blackraven14250 · · Score: 1

    Even better, just use both SkyDrive and Dropbox on the same folder. Problem solved.

  85. Do what you're doing now by Anonymous Coward · · Score: 0

    Have 2 different rsync tasks: copy laptop to stick (for when you're on the go) and copy laptop to backup HDD (for when you get home). If your laptop breaks while on the go, you copy the stick to the HDD.

    If you're worried about losing all your data at customs or whatever, you need a networked system.

  86. Re:Finally! An interesting question. by Anonymous Coward · · Score: 0

    You can't have an 8GB file in a FAT32 filesystem. You'd need exFAT for that, but if you're going to use a filesystem that many existing Windows installations can't read, you might as well format the stick with a proper filesystem in the first place.

  87. Use a real operating system by buttfuckinpimpnugget · · Score: 1

    hotplugd + duid's and rsync (which you sort of already use) on OpenBSD makes this a cakewalk, the real kind, not the Iraq kind. Or find their equivalents in linux.

  88. Re:Finally! An interesting question. by colonel · · Score: 1

    Perl is for anyone, sure, but it's certainly not for everyone.

    If the author and the user are the same singular individual, and always will be, then sure, perl can be a fun toy and a timesaver.

    But if you're mentoring junior sysadmins as part of your succession plan in a collaborative and evolving ecosystem, Perl is pretty much the worst choice available.

  89. Re:SkyDrive by Capt.+Skinny · · Score: 1

    That's fine it you're using it to make your files more accessible, but he is suggesting that it be used for backups. If you need to access the data, it means you probably don't have a local copy.

  90. Re:SkyDrive by Capt.+Skinny · · Score: 1

    The chances that something would happen right then in the time-frame that the cloud provider fails and you make another copy with another provider are incredibly low.

    Noticing that your backups have failed isn't the time to go searching for another backup solution.

  91. Re:Finally! An interesting question. by chelberg · · Score: 1

    bzip is better than gzip if space is at a premium. There are even multi-core versions of bzip2 that are very efficient. You could also look at p7zip. If you want a really efficient compressor, try nanozip as well, although its page says it is still experimental, but it seems to be at the top of several compression benchmarks.

  92. You're looking for dump, not rsync by subreality · · Score: 1

    Make full "level 0" dumps at home to the big disk. Make delta "level 1" or incrementing levels dumps to the flash drive. Each level will back up everything that changed since the previous level.

    Now, you want the backups at home to be a file copy - there's no reason you can't do that and then do level 1 dump backups on the road - ie, never actually make a level 0. Just do your rsync and then update /etc/dumpdates to reflect your rsync-level-0.

    This is exactly what dump was designed to do, and it's going to be a lot easier than hacking rsync to fit.

  93. Dude, who has the time to figure this out by Anonymous Coward · · Score: 0

    If you have time to figure out what this guy needs, then you need a job or at least to be paid for doing the analysis. Geesh.

  94. Re:SkyDrive by bingoUV · · Score: 1

    Why? One backup doesn't preclude a possibility of a second backup. Since hard disks fail, does it mean backing up to hard disk useless? Websites too fail, you are concluding backing up to websites is useless from it.

    --
    Bingo Dictionary - Pragmatist, n. A myopic idealist.
  95. Re:Finally! An interesting question. by robsku · · Score: 1

    Yes, bash can do that, and I highly recommend learning not only bash but also plain Bourne Shell - still, if you want to create actual backup tool and release it, I'd go with Perl. If you want it to be cross platform and not limited to *nix systems in that, again perl.

    If you haven't mastered the *nix tools mentioned, doing this with shell scripts, especially limiting yourself to plain Bourne Shell (Heirloom Bourne Shell is something to look into if your system, like linux distros, has /bin/sh as symlink to bash/dash), and those tools is a *great* learning experience, but another consideration for shell scripting vs. perl is speed and memory use. Consider these for making correct choice.

    Also, there can be other reasons against perl and for shell scripting - want to be able to share it between *nix systems that you might not have perl, just for one. Shell scripting can be great for cross platform, but limits you to *nix likes, and often limits you to plain Bourne Shell - one of many things bash has but plain sh has not is hashes, and you can program a way around that, but it will be hackish, slow and resource eating - but it's also awesome experience :)

    --
    In capitalist USA corporations control the government.
  96. Re:Finally! An interesting question. by robsku · · Score: 1

    ...also, some people can be jerks about these choices, like this poster replying about perl:

    Perl is for programmers that like to pretend they know how to be sysadmins and don't need to share their tools with other sysadmins.

    ...that is such a load... while with shell scripting combined with *nix tools you can get far, there are limits - scripts are great when used where they best fit, and sometimes the cost of hackish solutions around limitations, costs of taking tools beyond their optimal area, etc. are just too large to justify - except for doing something just for fun. Perl is a serious programming language, and even in sysadmin's scripts perl can sometimes be better than shell scripts (especially if it's not even meant to be shared with others), but there is also a point where a project starts to look more like program than script (not going into debating of the exact difference between those, I know anyone who can program probably knows what I mean), and that's one point where one should consider if shell scripting should give way to some other high level programming language. And as a high level programming language, perl has earned it's place, the above quote has no place in real world.

    --
    In capitalist USA corporations control the government.