Slashdot Mirror


Linux Backups Made Easy

mfago writes "A colleague of mine has written a great tutorial on how to use rsync to create automatic "snapshot-style" backups. Nothing is required except for a simple script, although it is thus not necessarily suitable for data-center applications. Please try to be gentle on his server: it is the $80 computer that he mentions in the tutorial. Perhaps try the Google cache." An excellent article answering a frequently asked question.

243 comments

  1. BEST POST EVER ON SLASHDOT by HimalayanRoadblock · · Score: 0, Troll

    OMG. I think I just had a fuckin coronary. He posted the Google cache. So we don't have to slashdot the guys own computer mentioned in the article. So walk the fuckin walk people. USE THE CACHE. And now Im not 1st post cause the 1 minute rule.

    1. Re:BEST POST EVER ON SLASHDOT by HimalayanRoadblock · · Score: 0, Offtopic

      Suck it down.® The asshole who moded this Troll is the same asshole logging onto the site instead of using the Google Cache.

    2. Re:BEST POST EVER ON SLASHDOT by Anonymous Coward · · Score: 0

      Hey Y2K-Spooge-homo-half-breed teenager. We've been sending your messages to your postmaster where you work. Let us know when the fun starts and they fire your disturbed ass.

    3. Re:BEST POST EVER ON SLASHDOT by Anonymous Coward · · Score: 0

      Nice try, but I'm neither Y2KBugs, nor a half-breed of any nature.

      Also I'd like to ask about the name you use to sign these alleged messages to the place where Y2KBugs works, but I do not.

      Oh, and since I know how much you miss my insightful links, I shall give you some more links to Linux.

      -Spooge

  2. thank you... by cmckay · · Score: 3, Insightful

    ...for posting a link to the Google cache in the story description on the main page! mfago, you are a genius!

    Perhaps more article submitters (or editors) could add these links more frequenly?

    1. Re:thank you... by zrodney · · Score: 2, Interesting

      Google cache

      yes -- that was a refreshing change from the
      usual postings where the page is /.ed . thank you!

    2. Re:thank you... by weird+mehgny · · Score: 2

      Also wait for Google blocking requests refered from slashdot.org when they find out how much bandwidth is at stake :)

      I prefer the idea that has been suggested by many previously, putting copies of linked articles right here on Slashdot.

    3. Re:thank you... by Monkeyman334 · · Score: 2, Insightful

      No way, I'd rather Joe Blow's server go down than waste google's bandwidth. Google doesn't have any ads on their cache pages. Slashdot should setup their own caching, or pay for a caching service, if they want to link it from the main page.

    4. Re:thank you... by Anonymous Coward · · Score: 4, Insightful

      Are you serious? Crush some guys server rather than using the publically available Google copy, because the Google page DOESN'T HAVE ADS?????? Who pays this guy for his server and bandwidth?? Do you make sure every page you view has ads on it? Are you a marketing exec or something??

      This "ads pay for everything on the internet" mentality is INSANE!!

    5. Re:thank you... by seanadams.com · · Score: 2

      Yes, lets not take unfair advantage of the hapless fools at google who aren't putting ads on their cached pages. Give me a break. Last I checked, those cached pages start with some text about google, and they contain google.com in the URL. EYEBALLS ==REVENUE for Google.

      I'm sure they're perfectly happy to get the exposure from Slashdot linking to their cache. If they weren't I'm sure their programmers could figure out if ($ENV{'REFERRER'}=~/slashdot/i) {print "Content-type:text/plain\n\nplease don't link directly to our cache.";}

    6. Re:thank you... by AvitarX · · Score: 1

      But then how can we Karma Whore?
      Sieriously people, the good stuff does get mirrored already.

      --
      Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
    7. Re:thank you... by ogre2112 · · Score: 1

      If caching becomes a big enough bandwidth problem for Google, I'm sure they would put ads in there.

  3. First Mirror by doublem · · Score: 4, Informative

    I had the chance to be the first post, but decided to mirror the site first.

    My mirror is here

    --
    "Live Free or Die." Don't like it? Then keep out of the USA
    1. Re:First Mirror by Anonymous Coward · · Score: 0

      Can't you guys come up with something sick and original for a change?

      like your mom?

    2. Re:First Mirror by Anonymous Coward · · Score: 0

      Yes, if you click on the links in the google cached version it tries to go to the original site which is slashdotted. If someone mirrors it they can adjust the links so they point to the local mirror and they work. Now go hump a dead nigger.

    3. Re:First Mirror by mikerubel · · Score: 1
      Matthew,

      Thanks for mirroring!

      Mike

  4. 'man dump' by isa-kuruption · · Score: 2, Interesting

    What's wrong with dump? It works great, and you can send stuff to gzip, bzip2, etc for data compression... even pipe the stuff over ssh to a server somewhere else. Dump also supports incremental backups. It also works on a lower level than rsync (which works on the filesystem level) and supports multiple volumes easily.

    1. Re:'man dump' by dhogaza · · Score: 2

      Why not read the article? Then you'll see why the author thinks rsynch is a better tool for network-based backups. You may not agree with the author but if you actually took the time to read the article you'd see that he is fully aware of the existence of dump

    2. Re:'man dump' by Dave9876 · · Score: 1

      Dump works well, except if you accidently created a filesystem using reiserfs before you deciede on the backup method...I don't like using tar for backups, it just doesn't work quite as nicely (and takes too many arguments to get a clean backup). Dump works low level enough to make everything soo simple.

    3. Re:'man dump' by isa-kuruption · · Score: 2

      The other thing I forgot to mention is that rsync does not support incremental backups. Sure, it will incrementally update the tree on the other end, but it will not allow you to go back to your filesystem snapshot from last saturday if you have done an rsync of your data since that point. It doesn't effectively keep a backup of old data, it just syncs the current data. This would make it difficult to recover from, for example, a box that was hacked and trojanned last week when you've done an rsync since.

    4. Re:'man dump' by GigsVT · · Score: 2, Informative

      Read the fucking article, that's the point. He uses hard links to make a second copy of the backed up directory, exploiting the fact that rsync always unlinks before changing a file, thereby effectively doing incremental backups without wasting hard disk space.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    5. Re:'man dump' by isa-kuruption · · Score: 2

      There's no need to get abusive, geesh... grow up.

      I specifically said "rsync" does not support that. Whether he fools around with a script to do it for him, is another story. MY POINT is that dump does this ALL FOR YOU, and would have required LESS time to implement and would be a more reliable solution, as it was designed for doing filesystem backups!

    6. Re:'man dump' by lems1 · · Score: 1


      one good reason... there is NO good HOW-TOs for dump on ext2/3... man is great, but somebody has to write something humanly readable/understandable for those of us who just don't bother to read all features of a command before using it.

      step 1) this
      step 2) that
      step 3) done

      --
      This sig can be distributed under the LGPL license
    7. Re:'man dump' by TarpaKungs · · Score: 2, Informative

      Hi

      rsync --backup-dir ...

      2 years ago I wrote a script to do pretty much what the linked product does - ie: maintain a duplicate set of data areas on another machine via rsync.

      I use the --backup-dir option to relocate copies of the files which the current rsync run would otherwise delete or modify.

      With a bit of rotation, we can have users helping themselves to a full view of their
      home directory as of last night and also be able to restore files effectively from each day of the week going back 7 days in our case.

      Sure does cut down on the number of tape restore requests.

      As mentioned it is incredibly efficient - we deal with about 900GB of data backed up in this way - but rsync actually transfers about only 10-30GB of differences each night.

      Only problem is my script was a crap prototype which is why I'm not letting anyone see it ;-)

      But I do have a design in my head for a more professional effort (will be opensourced) - I'm might even get enough peace at work to write it one day!

      --
      Why can't women be like Hedy Lamarr - beautiful, talented and inventors of frequency-hopping spread-spectrum techn
    8. Re:'man dump' by GigsVT · · Score: 4, Informative

      It's an expression, it's not particularly abusive.

      rm -rf backup.3
      mv backup.2 backup.3
      mv backup.1 backup.2
      cp -al backup.0 backup.1
      rsync -a --delete source_directory/ backup.0/

      There. That's the script basically. Add more snapshot levels as needed, stick it in cron at whatever interval you need.

      dump only supports ext2/3. This supports any file system, and retreiving a file from backups is as simple as running "cd" to the directory of the snapshot you need and "cp" the file out.

      I run backups from Linux to IRIX and other UNIXs using gnu rsync and openssh. This little trick is going to be very handy for me. I can't waste my time worrying about which filesystem type the files came from originally.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    9. Re:'man dump' by Anonymous Coward · · Score: 0
      and would be a more reliable solution
      IIRC Linus has said there are issues with dump.
    10. Re:'man dump' by Anonymous Coward · · Score: 0

      step 1) this
      step 2) that
      step 3) done


      step 4) profit!!!

    11. Re:'man dump' by mikerubel · · Score: 2, Informative
      Hi TarpaKungs,

      I was originally using the --backup-dir trick, and you're right, it allows you to back up the same data. The advantage to doing it as described in the article is that you get what appear to be full backups at each increment. This makes it simpler for your users, who can now think of the backup directories as full backups.

      Hope that helps--

      Mike

    12. Re:'man dump' by TarpaKungs · · Score: 1

      Certainly looks most interesting. That is quite a genius manoever, using cp -al - wish I'd thought of that :-) Now I'll go and read the article in depth rather than just skimming(!) All the best.

      --
      Why can't women be like Hedy Lamarr - beautiful, talented and inventors of frequency-hopping spread-spectrum techn
    13. Re:'man dump' by Blkdeath · · Score: 1

      One has to wonder why you'd back up mission-critical data with a low-level back-up application without fully understanding it in the first place.

      --
      BD Phone Home!

      Shameless plug. Like you weren't expecting it.

    14. Re:'man dump' by Macgruder · · Score: 1

      Syntax: dump -[increment level][options] -f [device] [location]. Usually located in /usr/sbin

      Increment Level = 0 - 9. 0 is a full backup. with a value above 0, copy all files modified since the last dump of the same or lower level. Default level is 9.
      Options = u a.

      • u = Update /etc/dumpdates after a successful dump.
      • a = autosize. Bypass all tape length considerations, writing until an end-of-media is reached.

      -f = specify a destination file. [device] = valid path or device. Ex., /dev/st0 (SCSI tape drive).
      [location] = source filesystem you want to backup. Ex., /home

      Usage example: dump -0ua -f /dev/st0 /home
      Make a full backup of /home to the tape drive /dev/st0, writing until the tape is full or end-of-media is reached, then write the results to /etc/dumpdates.

      --
      I'm not crazy,I'm actively irresponsible.
    15. Re:'man dump' by lems1 · · Score: 1

      no compression?

      I know how dump works though. I have used ufsdump on solaris (i'm a sysadmin for 7 solaris servers).

      --
      This sig can be distributed under the LGPL license
    16. Re:'man dump' by Macgruder · · Score: 1

      Nope, no compression options. At least on the software side. I leave it to the hardware, my trusty WangDAT 3400DX.

      --
      I'm not crazy,I'm actively irresponsible.
    17. Re:'man dump' by Thomas+A.+Anderson · · Score: 1

      Your point is that you didn't read the article, have no intention of reading it, and want us all to be impressed by what you know about dump.

      If you want to contribute to this discussion (and indirectly, this community), then read the freaking article first.

      thank you

      --
      Personally its not God I dislike, its his fan club I cant stand (bash.org)
  5. Works great! by schmutze · · Score: 3, Insightful

    I work with Mike and started using his scripts a while back for my own department. With HD space so cheap these days, it makes sense to have an online backup. Especially for those of us who can't afford a NetApp. It really saves time for restoring those every day user deletes. Way to go Mike!

    1. Re:Works great! by Cool+E · · Score: 1

      you might want to take a look at this for doing backups via rsync over ssh with no client side scipts to manage

  6. Unexpected use of the cache, so what? by Anonymous Coward · · Score: 0

    If Google is stupid enough to host our stuff for free on their high-bandwidth servers, why not take advantage of it.

  7. Re:Bandwidth isn't free, thats what. by Anonymous Coward · · Score: 0

    The more we use the google cache the more we save people's individual and commercial servers from gettin the slashdot salute.

  8. Re:Linux sucks by bob65 · · Score: 1

    Do not install your programs to it. But wouldn't I have to reinstall most of my programs if I reinstalled Windows anyways?

  9. Re:Linux sucks by Anonymous Coward · · Score: 0

    uhhh too bad you would still have to reinstall all your programs, because they all require registry entries, and dlls in your windows directory... nice try though "tosser"..

  10. I use this method at work by Bistronaut · · Score: 2

    I am the "computer guy" for a small company, and I use this method to make back-ups of our Samba file server. It's great! The main file server has Samba and everyone works off of it. The backup server has almost twice the disk space, but it doesn't really need that much. It never seems to be more than a couple of percent bigger. I keep 'snapshots' going back various time intervals up to a week, and do the tape backup off of the backup machine early in the morning. Thank you Mike Rubel!

    1. Re:I use this method at work by Cool+E · · Score: 2, Informative

      you might want to take a look at this for doing backups via rsync over ssh.

    2. Re:I use this method at work by Anonymous Coward · · Score: 0

      Just wanted to say I LOLed when I read you sig. Genius

  11. Re:Linux sucks by NiteHaqr · · Score: 1

    And the "small" partition had better be > 4GB otherwise downloading 1.1GB files over http may just come unstuck unless you move your windows temp directory.

  12. Re:Linux sucks (mod as funny) by gosand · · Score: 1, Offtopic
    A *real* operating system like Windows doesn't need 17 partitions, just one. So you backup one partition and you're done.

    I am really tempted to mod this up as Funny, but I am afraid that you are serious. There are so many things wrong with your statements that I don't know where to start. I guess I'll just have to assume that this was a joke, and you weren't really serious. If you *were* serious, then you really really need to educate yourself about these new fangled computer dealies.

    --

    My beliefs do not require that you agree with them.

  13. So... by Squeezer · · Score: 1, Informative

    Slashdot is now a reference for tutorials? Ever try www.tldp.org or www.linuxtoday.com (they post links to tutorials).

    --
    Does the name Pavlov ring a bell?
  14. Re:your sig by Anonymous Coward · · Score: 0

    It should be 'killall -9 love' not 'kill -9 start'.

  15. Re:Bandwidth isn't free, thats what. by NiteHaqr · · Score: 2, Insightful

    But wheres the sense of achievement of getting /.d if we all use the cache - /.ing is a sign that you have raised yourself above trollbait level.

    Its a sign of peer approval.

  16. Because Linus says dump isn't reliable. by glrotate · · Score: 5, Informative
    1. Re:Because Linus says dump isn't reliable. by Anonymous Coward · · Score: 0

      Nice to see that he supports his argument and baseless bashing of dump with adequate examples and references.

      Oh, you mean he just went off sans proof? Oh well, if Linus said it, it must be true, as Linus cannot be wrong. After all, the Bible is the word of God, and what God says must be true, hence the Bible is 100% truth.

    2. Re:Because Linus says dump isn't reliable. by zrodney · · Score: 3, Informative

      he says right there in the linked article that
      dump can't reliably back up the filesystem
      because of the kernel filesystem caching, and that
      future kernel development is headed further in that
      direction, so you might as well not depend on dump.

      seems pretty reasonable to me, go ahead and use
      dump if you like though

    3. Re:Because Linus says dump isn't reliable. by donutello · · Score: 2

      So Linux 2.4 was released with a major known bug in it which causes a critical backup feature to not work at all putting you at risk of losing all your work?

      I thought we beat up Billy Boy for doing that.

      --
      Mmmm.. Donuts
    4. Re:Because Linus says dump isn't reliable. by Anonymous Coward · · Score: 1, Funny

      This isn't a bug; it's a design issue.

    5. Re:Because Linus says dump isn't reliable. by Anonymous Coward · · Score: 0

      dump has been depricated for awhile now since it works on too low of a level.

    6. Re:Because Linus says dump isn't reliable. by Anonymous Coward · · Score: 0

      So the designers of Linux designed their backup program to corrupt data?

      That should do wonders for the sales of XP!

    7. Re:Because Linus says dump isn't reliable. by cloudmaster · · Score: 2

      Dump doesn't work with reiserFS, sync or no sync. AFAIK, it only works with the ext* systems, and it depends on the filesystem's internal structure being known. Low-level backups are bad.

      Tar or other systems that get the files through the regular file reading interface are better because they take advantage of the filesystem interface abstraction layer instead of going around it. That works well, and there's no reason to do backups otherwise. None. Not a single one. IMHO. :)

    8. Re:Because Linus says dump isn't reliable. by Anonymous Coward · · Score: 0

      This isn't a bug; it's a design issue.

      Linux needs better developers developers developers developers DEVELOPERS DEVELOPERS DEVELOPERS DEVELOPERS DEVELOPERS DEVELOPERS *pants* DEVELOPERS DEV*cough*ELOPERS DEVELOPERS DEVELOPERS *doubles over*.. HOOO Boyyyy. DEVELOPERS DEVELOPERS DEVELOPERS!!

    9. Re:Because Linus says dump isn't reliable. by MSG · · Score: 2

      Dump doesn't work with reiserFS

      The fact that reiserfs doesn't include a "dump" of its own isn't a failing in "dump", but a failure of the ReiserFS developers.

      Yes, dump is and always was fs-specific. That's something that's always been understood.

      It's also the only way to back up ACL's and other extended metadata. Data backup is good, but file metadata is important, too. You wouldn't back up your data with no file names, would you? File names are a small part of the metadata associated with a file. Tar and cpio only get a subset of that data.

      As filesystems move toward extending the amount of metadata they store (ACL's, and extended attributes now, ReiserFS is moving toward ever more complex metadata), backup programs are going to have to be extended to store that information in the archives. Until they do, only dump is reliable.

      Spread the word.

    10. Re:Because Linus says dump isn't reliable. by Anonymous Coward · · Score: 0

      You're a fucking moron.

    11. Re:Because Linus says dump isn't reliable. by Anonymous Coward · · Score: 1, Insightful

      If I tell you that I have two pieces of meta data, does that make the 'two' sort of a meta meta data? And if I say that I have one piece of meta meta data, does that make the 'one' meta meta meta data?

      Make it stop!

    12. Re:Because Linus says dump isn't reliable. by Anonymous Coward · · Score: 0

      Or you could just find a program that's clueful enough to understand your metadata WITHOUT undercutting the filesystem.

      GNU tar is right out for multiple reasons here - no metadata support, and it doesn't stream. The tape drive actually sits there waiting for data. GNU tar is 6 times slower than dump on my systems.

      My only solution so far has been star, a strange little tar program with wacko build techniques and arguments, but it does get the job done. It's also about the same speed as dump, and there's no funny stuff happening with direct access to the block devices.

    13. Re:Because Linus says dump isn't reliable. by cloudmaster · · Score: 2

      My point is that going around the kernel-provided filesystem access methods is bad. Dump's *implementation* is a bad one. If there's data stored that can't be read using standard utilities and the standard filesystem interface, then it shouldn't need to be backed up.

    14. Re:Because Linus says dump isn't reliable. by MSG · · Score: 2

      The problem isn't that the data can't be read by standard interfaces, but that tar and cpio just don't know about them yet. ACL's, for example, are a critical feature, long missing from open source UNIX platorms (they're common on some other UNIX platorms, and of course NT).

      Tar and cpio back up the standard UNIX permission set, but that set is really inadequate. Until they can back up the full set of ACL's, they're basically useless on systems that use them.

  17. Tar? by Badanov · · Score: 1

    I use tar to maintain critical daily backups. I am still pretty new to Linux, so does this essentially do the same thing?

    --
    Dawn of the Dead
    1. Re:Tar? by Anonymous Coward · · Score: 0

      I'm not a guru, but I don't really see what the problem would be with using tar for data backups.

      It is probably slightly more difficult to administer than other methods, but it does work.

      One problem with it is cataloging. That is, if a drive fails, or a file is over-written, how do you know what to restore? You don't want to search all the way through every tape to find which one to restore. Also, if you have more than one archive on a tape, how do you find the end of the last archive? And how do you know how much room is left? All of these questions have answers, but the bottom line is that for many people, tar is too low-level to use for backups.

      Having said that, I use tar at home. I use "mt tell" after a backup to determine where the tape is. I record this in pen on a piece of paper inside the tape case. When it is time to add another archive to the tape, I use "mt seek" to get to the next available space, and start my backup from there. Whenever I read or write to the archive, I do "mt retension" first. I don't keep any catalog that has all the filenames on it.

      A solution for the file catalog problem would be to use "find" to create a list of files first. Write this list to the tape BEFORE actually writing the archive, or make this list the first file in the archive (somehow) and use a standard name so you can easily extract the list first. Make sure you record access and mod times and dates as well as full path to the file. This will only work well for offline backup, where the entire volume is mounted read-only. At the minimum, you have to make sure that no files are changed in any way between the time you record the catalog info and the time you back them up. You don't want a catalog that doesn't mach the archive

      --
      AC

    2. Re:Tar? by mikerubel · · Score: 1
      Badanov,

      I use tar to maintain critical daily backups [...] does this essentially do the same thing?

      Not exactly. This is not a substitute for tar; it can work in conjunction with tar to reduce your backup work and make simple, day-to-day restores easier. Check out the article and let me know what you think!

      Mike

    3. Re:Tar? by Badanov · · Score: 1

      Never dealing with rsync, I can't comment on that part. What I can comment on is that I use tar as an adjunct to other backup activities. My backup needs are not as often as yours are apparently, thus the need for a snapshot isn't as great. I use NFS mounted read/write from the backup machine, which is a dedicated backup storage machine and I keep it there 24/7. The main file server also mounts the backup machine but only once a week and then unmounted and only for the purpose of allowing testing of the backed up files. I do not test the tars at all, since the files are MS type files and I need the MS 'functionality' to fully check them. Both machines' NFS activities are regulated by cron and both are logged to ensure they are functioning. Now this network is not on the internet (and with the users I have it shouldn't be) so my security needs are far less than if those machines were on the internet. Having said all this I have to say that rsync over SSH seems to be a nice solution if you want to backup files to a remote machine if you have just once machine with an internet interface of any kind. I have been wanting to have additional backup safety without using ftp on a remote box and I will look into that and without needing a CD burner on the backup server.

      --
      Dawn of the Dead
    4. Re:Tar? by Cool+E · · Score: 1

      tar isn't that reliable for backups

  18. rdist can perform same task with more flexibility by Scotter · · Score: 1

    I use rdist to do much the same thing.
    A simple example for my home directory is:

    #
    # Make a local copy of the contents of the home directory.
    # Also make a local copy populated with hard links.
    #
    # This has the effect of preserving snapshots through time
    # without too much overhead. (Cost of hard links + changed files.)
    #

    ~ -> localhost
    install -oremove /misc/backup/current ;
    except ~/tmp ;
    cmdspecial ~ "DATE=`/bin/date +\"%%Y-%%m-%%d.%%T\"` ; cp -al /misc/backup/current /misc/backup/snapshot.$DATE" ;

    Note that I get dated backup directories, and that I can add as many "except" clauses as I want, so I don't need to backup junk directories.
    (.mozilla caches, etc.)
    My backup drive is mounted via automount, so it is rarely mounted. Just change "localhost" to host the backup on another machine.

  19. tar or dd? by dacarr · · Score: 1
    seems reasonable. tar would back up files, and dd, unreal as the syntax is, would also do the same thing.

    I guess the whole thing goes to prove that, within anything computer related, there is more than one way to do it. Clever tutorial, gang. =^_^=

    --
    This sig no verb.
    1. Re:tar or dd? by Anonymous Coward · · Score: 0

      Yeah, but dd has issues too.
      Tar works surprisingly well, in that it always maintains permissions etc (assuming it's got permission to). dd makes a pretty much bitwise copy, and in some circumstances that can actually be a bad thing. Say you are backing up a 10meg mysql isam flatfile, and mid copy a write happens to the file, you will have a destination file that has faults or is unrepresentative of any specific instance of time.
      I don't know why, but I've never had that prob with tar (maybe it locks files better?).
      And as far as I understand, rsync accounts specifically for it, so dd is not always the best option on a LIVE system. Plus I am not aware of a methodology for using dd to copy , say a /var/userdata directory into a /var/backups/rara directory. Tar can be incorpated with gzipped pipe majik to get that data put somewhere on a separate volume at a faster rate then an uncompressed stream will be allowed for over the bus and with mechanical vibes taken account of.

    2. Re:tar or dd? by Cool+E · · Score: 1

      tar isn't reliable

  20. Critical daily backups done by the clueless. by Anonymous Coward · · Score: 1, Funny

    And people wonder why computer techs get a bad name.

    1. Re:Critical daily backups done by the clueless. by Anonymous Coward · · Score: 0

      I must have missed the part where he said he was a computer tech...

    2. Re:Critical daily backups done by the clueless. by Old+Man+Kensey · · Score: 2
      Yet another Anonymous Coward spewed forth:

      [referring to using 'tar' to do daily backups]
      And people wonder why computer techs get a bad name.

      Eh? There's nothing wrong with tar per se. For example, let's say you want to transport your backups over a network securely (i.e., via ssh). Your choices are:

      1. Allow ssh access with no password (public-key access, preferably). I'm leery of this, because allowing anything like this to run automatically means entrusting all the auth data to the machine, where it can be compromised.

      2. Copy the backups asynchronously from making them, allowing user-initiated authentication. This was the approach I opted for when I had to put together a backup system overnight at one company.

      Couple of cron jobs that ran incremental tar's on a list of directories, storing them in the scratch partition with higher permissions (so user processes cleaning up after themselves couldn't nuke them accidentally). Then at my leisure I would run the transport script (mornings about 10 AM, typically) which would suck the backups across and copy them to the tape. This worked fine for the time the project was active. Note that I was backing up to tape, which meant I needed to manually rotate tapes anyway, so this system helped ensure that new backups didn't overwrite old ones if I came in late -- and we definitely did not want these backups exported to our network. I also had the advantage of only needing to worry about one server.

      Just because tar is old and a bit... esoteric at times, doesn't mean it's therefore automatically a stupid idea to use it. If it's what you know, and it gets the job done, there's no need to feel guilty about not using a fancier system. Even Linus likes tar, because it's rock-solid reliable.

      Now if you have (faint hope) a valid criticism of this guy's use of tar in his environment, then I'm all ears. But I doubt that, since he didn't give enough detail for you to have one.

      I don't know why I even bother with this given it's an AC post, except that assholes like this are a major reason why Linux advocates get a bad rep.

      --
      -- Old Man Kensey
  21. Re:Win2k has free backups made easy, too! by akc · · Score: 1

    Except that with your approach you have to get up every 4 hours through the night to replicate what this guy has achieved.

  22. Re:Win2k has free backups made easy, too! by LinuxGeek · · Score: 0, Offtopic

    That reminds me of a question: What do you call women that rely on the rhythm method of birth control? Mother!

    Conversely: What do you call Sysadmins that us MS backup for critical data? Jobless!

    --

    Kindness is the language which the deaf can hear and the blind can see. - Mark Twain
  23. tar and ftp on cron by Anonymous Coward · · Score: 0

    I tar -czvf directories, name them appropriately with a time stamp, and ftp those files to a server that will write it to tape. That's really simple.

    1. Re:tar and ftp on cron by Cool+E · · Score: 1

      tar isn't that reliable

    2. Re:tar and ftp on cron by catmaker · · Score: 1

      I've lost count of the number of times you've said that tar isn't reliable. What on earth do you mean?

      --
      status is failure. status is failure
    3. Re:tar and ftp on cron by Cool+E · · Score: 1

      If you use tar to backup files it can screw you over because if the tar archive get currupted 4K into the file then you can't restore the rest of your files. If you insist on using something like tar I have heard good things about BRU

  24. Re:Win2k has free backups made easy, too! by gosand · · Score: 1, Offtopic
    Really? You can use Win2k to back up your Linux drives? How does that work? If you will notice, coward, this is not an article that has anything to do with Win2k.

    Move along, sheep. Go wait for your shepherd to tell you what to do.

    --

    My beliefs do not require that you agree with them.

  25. Oh waaa by Anonymous Coward · · Score: 0

    I'm so sorry you don't want us to kill your poor $80 server but if it can't handle it then don't put it up on /. It's gonna get killed. Besides it should be a lesson in how it will perform in the future--an $80 computer performs like an $80 computer. You get what you pay for man....

    1. Re:Oh waaa by mikerubel · · Score: 1
      Actually, I didn't post this; the slashdotting came as a complete surprise. I would have cleaned up the page if I knew all this traffic was on its way! My roommate is pretty annoyed that he can't play online games though. :)

      Interestingly enough, the server has plenty of extra capacity, it's the cable modem connection that seems to have been saturated.

      Thanks in advance for being courteous and using a mirror or the google cache!

      Mike

  26. Check out glastree by Soylent+Beige · · Score: 3, Informative

    Been using a script called glastree on several production file servers for quite some time now.
    It work just great! At one site I've got about 7 weeks of depth from 3 different servers all
    mirrored via ssh-nfs on one lowly Penti 133. We still spin tapes mind you, but glastree has
    been flawless.

    Been meaning to buy the author a virtual beer for some time now . . .

    http://igmus.org/code/

    From the website:
    'The poor man's daily snapshot, glastree builds live backup trees, with branches for each day. Users directly browse the past to recover older documents or retrieve lost files. Hard links serve to compress out unchanged files, while modified ones are copied verbatim. A prune utility effects a constant, sliding window.'
    --

    --
    Everyone hates me because I'm paranoid.
    1. Re:Check out glastree by GigsVT · · Score: 1

      'The poor man's daily snapshot, glastree builds live backup trees, with branches for each day. Users directly browse the past to recover older documents or retrieve lost files. Hard links serve to compress out unchanged files, while modified ones are copied verbatim. A prune utility effects a constant, sliding window.'

      It looks like this might be almost the exact same thing as is linked in the article. It's the same basic premise.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    2. Re:Check out glastree by mikerubel · · Score: 1
      Thank you--I wasn't aware of this software! I'll check it out.

      Mike

    3. Re:Check out glastree by Jeremy+Wohl · · Score: 2, Informative
      Hi, I'm the glastree author.

      Yes, my software does essentially this, wrapped up in a nice utility (though, you get day resolution).

      What we want, of course, is a better replica of plan9's dumpfs, featuring a real filesystem layer and compressed block differences. This is on my TODO list.

      -jeremy

    4. Re:Check out glastree by Cool+E · · Score: 1

      You might want to take a look at this. It does all of this but no client side script to maintain.

  27. Rsync + Samba = Pretty good backup by Malduin · · Score: 1

    We have a hybrid network of Win2k and Linux servers at work. Our backup server is a Win2k box with a little over a terabyte of storage. We have an internal "utility" Linux box that is running Samba and rsync. For our production Linux boxes, we only have rsync to use for backups. The interesting way we back up the production boxes is by rsyncing to a backup share on the Win2k backup server that is mounted on the utility box using samba. At first, we thought that this would make things kinda slow, but actually they run at full speed.

    Just thought I'd share our little Linux backup experience.

  28. Re:Linux sucks by ketamine-bp · · Score: 1

    experienced windows (l)users here in the asia side usually uses 3 partitions - one for windows and its applications, another for ghost and the ghost image to renew the partition for windows and applications. the thrid partition stores data like word files and icq database...

  29. Slashdotting by rela · · Score: 1
    Somewhere, Michael is laughing his butt off at having slashdotted his friend, especially considering he posted the story with a mirror so 'it's not his fault'.*

    *(change all pronouns to the appropriate gender)

  30. What about MAC OS X??? by Eric_Cartman_South_P · · Score: 2
    Does anyone know how something like this would work on Mac OS X? The backup utility is the only thing I like about their .NET^H^H^HMAC service.

    1. Re:What about MAC OS X??? by BlueGecko · · Score: 2

      SilverKeeper (http://www.silverkeeper.com/) from LaCie is the only free backup solution for OS of which I am aware. While not as full-featured as Retrospect, it's not bad if all you want to backup is your /User directory and maybe a few other things. You can set up specified things to backup, and then restore them or synchronize them. (In fact, its synchronization feature makes it extremely handy with an iPod, where you can use it to ensure that the Documents folder on both devices is always the same without having to delete the folder on the iPod and then recopy it each time.) If you need to backup everything on the disk, however, pretty much your only choice is going to be to use the extremely buggy ditto command with the command line utilities for manipulating .dmgs, or alternatively to purchase Retrospect. .Mac's backup solution is awful and does not seem, IMVHO, to offer anything over SilverKeeper. You'd be better of spending that $100 on Retrospect anyway if that is the only thing you are interested in.

    2. Re:What about MAC OS X??? by Lao-Tzu · · Score: 1

      You can do the exact same thing in OS X. You just need to get rsync, which can be installed as part of fink if you have it.

      Otherwise, you can get the rsync sources yourself and build it without too much trouble.

    3. Re:What about MAC OS X??? by mfago · · Score: 1

      My version of OSX has cron and rsync. I dpon't see why it wouldn't work. It should even be possible for someone to write a simple GUI for those that would like that.

    4. Re:What about MAC OS X??? by sethdelackner · · Score: 1
      What about it? Every technique that is described in this article is fully doable on OS X. It has rsync and supports hard links.
      Since OS X doesn't include gnu 'cp', you can just use the alternative method described in the article:
      Simply replace cp -al a b with cd a && find . -print | cpio -dpl ../b

      Am I missing something?
    5. Re:What about MAC OS X??? by mikerubel · · Score: 1
      Since MacOS X has a BSD core, this trick should work there too. All it needs are hard links (present in almost all UNIX-like OS's), rsync, and either GNU cp or cpio. Please let me know if you get it working!

      Mike

    6. Re:What about MAC OS X??? by ewwhite · · Score: 1
      You can use psync, located at:

      http://www.macosxhints.com/article.php?story=20020 711091017747

      It's a perl-based "rsync-like" utility that can handle the Unix permission, resource fork and incremental challenges of OS X backups. Check it out.

      --
      Edmund White
      http://flickr.com/ewwhite
    7. Re:What about MAC OS X??? by Permission+Denied · · Score: 2
      This will work fine with OS X if you use UFS.

      This won't work with HFS because of the file forks. If you use UFS with OS X, the file forks appear as normal files. Eg, if you have a file named "foo", "._foo" is the resource fork. I don't know where they keep the finder fork, and I've never cared to investigate.

      Here's a tip if you have to use OS X for a file server of any kind: use two partitions (or two disks), one HFS and one UFS. The OS and any applications are installed on the HFS partition and all data goes on UFS. Use HFS for the OS because a lot of stuff breaks when running under UFS and UFS performance is still roughly twice as bad as HFS in 10.2 (run your own little benchmarks if you don't believe me). Keep user data on UFS so you can use tools like tar, rsync, etc. to back up and manipulate files. Remember, tar won't work on most HFS files (those with forks). If you're deploying OS X Server, you should definitely keep user data on a separate partition anyway since any tiny little mistake (eg, LDAP typo in Directory Assistant) will require a reformat-reinstall.

      Another tip: if you create a tarball off a UFS filesystem and then untar that onto a HFS filesystem, it will preserve the forks correctly. This has come in quite useful in making "setup" scripts for end-user machines, where all the applications to install are stored in tarballs created on a UFS machine and you can untar them onto the target HFS machine (the advantage is that you can script this - add in a couple of niutil commands and you can recreate a user machine in a couple minutes from one script).

      I have a couple of OS X Server machines (bosses like the GUI user management stuff). I just tried rsync over NFS to a Linux box and it works fine since the data is on a UFS partition on the OS X Server box. PITA to set up an NFS share remotely (since I don't have Macs at home -> no Remote Desktop, no usable VNC servers for OS X -> have to do it over ssh -> must figure out how NFS exports are stored in netinfo -> gnashing of teeth), but it works and I might try this little trick next week since we're not doing anything systematic for backups on the OS X boxen.

      Also, radmind is a great tool for managing filesystems of OS X client machines. It supports HFS (by using AppleSingle internally).

    8. Re:What about MAC OS X??? by goombah99 · · Score: 1
      Wow. you sure read my mind on the question about forks. I'm setting up my first raid Xserve (jaguar) and am trying to figure how much to partition where and whther to UFS or HFS it...

      it's going to serve a giant pentium linux cluster of scientific compute nodes. But I will probably also use it as sort of a storage depot for my apple laptops. might even serve my mail and local web off it too.

      I sure would like to be able to ask you some questions, if you dont mind. If your willing my e-mail is delete the capitals in ceNOms@iSwPAMon.com

      --
      Some drink at the fountain of knowledge. Others just gargle.
    9. Re:What about MAC OS X??? by Anonymous Coward · · Score: 0

      OK, serious misinformation here. Kevin Boyd, University of Michigan, has worked his butt of to work HFS support into rsync. Download it here. Second, as someone else noted, psync is a great utility for backing up Mac OS X -- makes complete bootable backups, does synchronization too. Another great utility is Carbon Copy Cloner -- its a GUI utility for ditto; very simple to use, works with Jaguar, makes a full-bootable backup if so desired. Get it here.

      Finally, there is Apple Software Restore. Command line geeks will like the version that ships with Mac OS X Server 10.2. Simple to use, works at the block level, great for mass deployment, works over a network (even over http!), not really appropriate for general backup.

    10. Re:What about MAC OS X??? by Cool+E · · Score: 1

      /me points at stitch. It /should/ backup osx as long as you run ssh on the box and have a user called root.

    11. Re:What about MAC OS X??? by Kalak · · Score: 1

      OSX VNC server still has some life, even with the domain name dead. The author is hosting it at http://homepage.mac.com/muhaque with the startup scrips stetup at http://blonde.homeip.net/webload/

      --
      I am, and always will be, an idiot. Karma: Coma (mostly effected by .hack)
    12. Re:What about MAC OS X??? by Permission+Denied · · Score: 1

      I was wondering where this went because I found it quite useful. Hopefully the newer versions fixed stuff like the tilde key not working, etc. It'd be nice if it came with source so I could figure out what the problem with the tilde key is.

    13. Re:What about MAC OS X??? by Kalak · · Score: 1

      The source is there as well. No address for the original author though, and no mailing list/forum available. I'm tempted to add this to Sourceforge, or just host it at work.

      --
      I am, and always will be, an idiot. Karma: Coma (mostly effected by .hack)
  31. Re:Win2k has free backups made easy, too! by Profane+Motherfucker · · Score: 1

    Really? You can use Win2k to back up your Linux drives? How does that work?

    There's a little daemon called 'Samba.' It's fairly obscure, and doesn't have many users, but I will explain how it works:
    one can create SMB shares available to Windows clients, and then use the rather trivial Win2k backup util.

    You might find mention of 'samba' in the bowels of Google somewhere, but I don't think anyone still uses it.

    It's ok to use easy stuff for backups, just as users of automatic transmissions aren't pussies or limp wristed buffoons for picking something simple and automated.

  32. Backups are for wimps by Anonymous Coward · · Score: 1, Funny

    Backups are for wimps. Real men upload their data to an FTP site and have everybody else mirror it.

    1. Re:Backups are for wimps by Anonymous Coward · · Score: 0

      Thank you for stealing that quote form Linus!

  33. SSH comment needs to be added! by Anonymous Coward · · Score: 3, Informative
    This sounds great, I would like to thank the author for the article. Only one thing really should be added. The way that you should do rsync for a back up server is to do rsync over ssh with a passwordless connection. (see http://www.unixadm.net/howto/rsync-ssh.html with google cache)

    Also, it should probably also be done from the real server to the backup server so that you can not just break one machine and get into all. (if you break into the real machine as root then you should be able to get into the backup machine)

    This allows the backup machine to have only one open port. ssh which can be tcpwrapped to allow connections only from the machines that it backsup.

    1. Re:SSH comment needs to be added! by mikerubel · · Score: 1
      Anon,

      Thanks for the suggestion! This should work fine. My only worry would be that if someone compromises the original machine, (s)he would presumably have access to whatever information it uses to authenticate itself to the backup server. If you take this approach, it would seem to make sense to lock down sshd on the backup server to only one command (namely, the one needed to initiate a snapshot). Even then, though, the attacker could wipe the original machine and force backups until the original ones are pushed off the end of the queue! More safeguards, such as a time-delay on the server, might be necessary.

      I like the idea of having the backup server ssh into the client, but then the client has to accept inbound-ssh from root, which has security implications as well.

      Mike

    2. Re:SSH comment needs to be added! by Cool+E · · Score: 1

      you might want to take a look at this. it does backups via rsync over ssh using ssh keys.

    3. Re:SSH comment needs to be added! by spencerogden · · Score: 2

      The way ssh keys work is such that if the remote machine (the machine being logged into and backed up) only has the public key, which as its name suggest is ment to be public.

  34. Re:your sig by Anonymous Coward · · Score: 0

    He probably couldn't fit that in 120 chars. Kinda silly sig in any case. Not very funny.

  35. oh my, rsync backups roxxor by Dr.+Awktagon · · Score: 3, Interesting

    I've been doing backups this way on Linux for aLongTime(tm). On FreeBSD I've also used dump/restore to an NFS-mounted RAID drive (does dump work okay on Linux these days? I've always been afraid to try it for some reason, maybe earlier versions weren't stable).

    rsync is just so cool. First of all, it can work over the network through ssh, or through it's own daemon (faster), or on a local filesystem. You can "pull" backups from the server or "push" them from the client. Over the network, it can divides the files into blocks and just sends the blocks that are different. It has a fairly sophisticated way to specify files to exclude/include (for instance, exclude /home/*/.blah/* can be used to not save the contents of everybody's .blah directory, but keep the directory itself). You can set up a script to just backup given subdirectories so you can checkpoint your important project without backing up the whole show. etc etc.

    I use it both to save over the network using the rsync daemon, and to a local separate drive. On a local drive it's great, because you can easily retrieve files that you've accidentally deleted, just using cp. It's also great for stuff like "diff -r /etc /backups/etc" to see if something changed.

    I never thought of his technique for incremental backups, but since it uses hard links, I wonder how that interferes with the original hard links in your files?? Looks interesting.

    There are many flags and options that rsync has, here are the ones I use to pull complete backups from another host onto a local drive (yeah --archive is a bit redundant here).

    rsync --verbose --archive --recursive --links --hard-links \
    --perms --owner --group --devices --times --sparse \
    --delete --delete-excluded --numeric-ids --stats --partial
    --password-file=/root/.rsyncd.password \
    rsync://backupuser@xyz.dom.com/full/ \
    /backups/systems/xyz/
  36. rdiff-backup is easier and more efficient by heydan · · Score: 5, Informative

    The backup scheme described here uses hard links to avoid storing multiple copies of identical files, but when a large file changes even in a small way it stores a whole fresh copy of that file. rdiff-backup is more efficient because it stores one complete copy of your current tree with reverse diffs that allow you to step back to previous versions if you need to. If a large file changes in a small way, only the reverse diff is stored to encode that. This is very handy for cases where, for example, a multiple megabyte e-mail inbox has had just a few kilobytes of new messages appended to the end (although the rsync/rdiff-backup algorithm is also efficient with changes in the middle of a file). Being more efficient in this way translates directly to an increase in the number of past versions you can fit in the same space which can make all the difference if it takes you a while to realize that a given file has been accidentally deleted or damaged.

    http://rdiff-backup.stanford.edu/

    1. Re:rdiff-backup is easier and more efficient by Anonymous Coward · · Score: 0

      Oh come on, how often do you even change a file? And how big would it be?

      Are you actually a musician that edits his mp3s in place? are you drawing on your pr0n?

      Heck, even if you tell me that you're a programmer making changes to source code, how big is your biggest source file? 5k? 30k? If you were to store 10 different versions of this file it would only take up 300k. Are you actually going to waste your time calculating diffs on object files?

      Heck I'm working on a 150k word document (figures and such), and I have about 10 copies of it right now, at dfferent stages of our work so we can copy and paste stuff we deleted. Who cares about diff anyway?

      Most people have only a few files they are working on at any given moment in time. Look through your most recently accessed documents. I doubt you've changed a couple megs of files in the last couple of weeks. The rest of the stuff that you want to back up are full files. new mp3 rips, new pictures from your digital camera, new binary versions of your programs. Stuff that doesn't change. And for this there's no point in wasting time with a diff.

    2. Re:rdiff-backup is easier and more efficient by Anonymous Coward · · Score: 0

      Like the guy said: email. In my home directory, the largest directory is digital camera pictures. The second largest is email, and it's pretty close. The email files are all ~10MB and only a few lines in them change between backups.

    3. Re:rdiff-backup is easier and more efficient by mikerubel · · Score: 2, Informative
      Thanks for mentioning this!

      Rdiff-backup is an excellent utility, and Ben Escoto (its author) and I link to each other. You must realize, though, that the purposes are different. Rdiff-backup is more space efficient for things like text, email, and so on. My rotating snapshot trick is less space-efficient, but much simpler for the average user to understand ("just go into your snapshot directory and copy the old file back into reality"). It works on all kinds of files, and barely touches the CPU (since it isn't doing diffs). I would use rdiff-backup for administrative backups of email, code, and that sort of thing, where text is involved and user restore is not an issue.

      Different tools for different jobs!

      Mike

    4. Re:rdiff-backup is easier and more efficient by heydan · · Score: 1

      But you're using rsync which has to do all the same diffs that rdiff-backup does. The whole point of rsync is to figure out which parts of a file have changed so it can send only the differences. I believe you when you say your method barely touches the CPU, but I think it's still doing the diffs thanks to rsync. Please correct me if I'm wrong.

    5. Re:rdiff-backup is easier and more efficient by Anonymous Coward · · Score: 0
      (it's mike again...i don't have the password here though. sorry!)

      The rolling-checksum algorithm that rsync uses is quite efficient, and is different from diff. Tridgell and MacKerras wrote the original paper on it, which you should be able to find on google. It's very interesting from a technical point of view!

    6. Re:rdiff-backup is easier and more efficient by heydan · · Score: 2, Informative

      Yes, but rdiff-backup uses librsync to do its work. It benefits from exactly the same algorithm that rsync does. I agree it's very efficient. I'm just saying you don't avoid any of the work of computing diffs by using rsync as opposed to rdiff-backup so that should not be a reason to choose one method over the other.

    7. Re:rdiff-backup is easier and more efficient by sc0rpi0n · · Score: 3, Informative

      I've used rsync for my backups until now, but I've downloaded rdiff-backup 0.9.5 and I love it already!

      New users: use the development version, it's a lot more efficient if you have a lot of small files, because it uses librsync instead of executing rdiff for each file. I've measured a factor 20 speedup on my devel directory!

  37. This is really neat. by GigsVT · · Score: 1

    I was about to start using --backupdir with my rsyncs to do incremental, but this is a lot more slick. Right now I just run it with --delete weekly, so my live backups vary from none to 7 days old for deleted files. We run tapes too, so it wasn't a big deal, but the tape robot is on the way out, so I needed to get true incrementals going soon.

    It's stories like this that keep me reading Slashdot. (Other than ranting on YRO stories, but that is no where near as cool as a neat trick like this)

    --
    I've had enough abrasive sigs. Kittens are cute and fuzzy.
  38. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  39. What I'd really like... by MadAndy · · Score: 5, Interesting
    This method, like most backup solutions, doesn't take a backup as at a specific instant, but instead takes it over a period of time - the length of time required to make the backup, which can be a problem if the data being backed up is changing all the time.

    A few years ago I saw a neat (expensive!) disc array that could 'freeze' the disc image at a single point in time so that a backup could be taken from the frozen image. The backup software saw only the frozen image, while the rest of the OS saw the disc as normal including updates made after the freeze occurred. The disc array maintained the frozen image until the backup was complete, guaranteeing a true snapshot as at a specific instant in time.

    I wonder whether such a thing would be possible in software. Possibly it can even be done through cunning application of the tools that we already have. I imagined that you might be able to do something like it by extending the loopback device interface. Does anyone out there have any cunning ideas?

    1. Re:What I'd really like... by gordon_schumway · · Score: 5, Informative
      Then you should check out LVM. From the LVM HOWTO:
      A wonderful facility provided by LVM is 'snapshots'. This allows the administrator to create a new block device which is an exact copy of a logical volume, frozen at some point in time. Typically this would be used when some batch processing, a backup for instance, needs to be performed on the logical volume, but you don't want to halt a live system that is changing the data. When the snapshot device has been finished with the system administrator can just remove the device. This facility does require that the snapshot be made at a time when the data on the logical volume is in a consistent state, later sections of this document give some examples of this.
      --

      Ha! I kill me!

    2. Re:What I'd really like... by Cyberdyne · · Score: 2
      A few years ago I saw a neat (expensive!) disc array that could 'freeze' the disc image at a single point in time so that a backup could be taken from the frozen image. The backup software saw only the frozen image, while the rest of the OS saw the disc as normal including updates made after the freeze occurred. The disc array maintained the frozen image until the backup was complete, guaranteeing a true snapshot as at a specific instant in time.

      Sounds like the Network Appliance Filer's "snapshot" feature, but less advanced. (You can also get exactly the feature described under Linux purely in software, via LVM, now.) Under the NetApp version, you gain an extra directory ".snapshot", which contains previous versions of each file. So, if you screw up editing some file (delete/corrupt it, whatever) you can just grab a previous snapshot copy. Like having a series of online backups - but without all the extra space+hardware needs. Like CVS, but without the hassle (or fine-grained control) of doing "commits". Just tell the Filer "take a snapshot now" and 30 seconds later, it's done. Or "take snapshots every hour".

      Neat feature - you could almost get this using LVM under Linux, but not quite...

    3. Re:What I'd really like... by Fweeky · · Score: 2

      FreeBSD 5 will ship with UFS snapshots which will do what you want; it's also used to freeze the disk state for background fsck's, among other things. They're even stackable.

    4. Re:What I'd really like... by sc0rpi0n · · Score: 1

      The Linux LVM (Logical Volume Manager) supports this, take a look at the LVM page

    5. Re:What I'd really like... by bozoman42 · · Score: 1

      And to preempt those that say "Yes you can do this with LVM!", no you can't. Filers can use regular store space for snapshots if they run out of snapshot reserve, whereas LVM just stops doing copy-on-write if it runs out of snapshot reserve, effectively becoming completely useless from that point on. There's a huge difference in convenience there -- with Linux LVM you must constantly watch space usage of your snapshots vs available VG space vs the snapshot volume sizes you're creating. Hmmmm... Maybe if I wrote a daemon/cron-script to automagickally lvextend snapshot volumes that were close to capacity, that might help a lot....

    6. Re:What I'd really like... by bozoman42 · · Score: 1

      (Of course, you couldn't really lvreduce your main LV's to give space to snapshots, so you're still not 100% there with a cron-script.)

    7. Re:What I'd really like... by Kashif+Shaikh · · Score: 1

      the length of time required to make the backup, which can be a problem if the data being backed up is changing all the time

      All the backup solutions do their job, it's just that while the filesystem they backup maybe consistent, the data--from an application standpoint--may not be consistent when taken at a certain point in time.

      So what to do if the data is being changed all the time? Databases, which can be constantly changing from one second to another use transaction logs. Every operation that commits to the db(ie. add/delete/update/etc) is written to this log. If and when the database needs to be restored for any reason, the db simply needs to step through the entire log and redo the operations. Of course I'm pretty sure you can take the db server offline, and make a backup of the data at a consistent point. Then you can use the transaction logs to only redo operations from a certain point.

      What I just described is what I learned through my database classes while in university, so take my comments with a grain of salt as I've never worked with a Real Database(tm) before.

    8. Re:What I'd really like... by afidel · · Score: 2

      This and the remote mirroring is why I love our netapps so much. I have never had to pull files from tape for anything that is on the netapp because we have it set to pull snapshots hourly during the day and each day for a week plus each friday for a month. This way you have tight granularity for the day and week and can still pull back a file from up to a month ago. I don't care that our net f880 cluster is around $150K for only 4TB of raw space, or about 2 TB of usable space, it pays for itself in lower admin time and the basically zero loss of data it provides (yes we still do tape backups but mostly for disaster recovery, like I said I have never in 2 years pulled anything from tape for the netapp.)

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
    9. Re:What I'd really like... by Gadzinka · · Score: 1

      A few years ago I saw a neat (expensive!) disc array that could 'freeze' the disc image at a single point in time so that a backup could be taken from the frozen image. The backup software saw only the frozen image, while the rest of the OS saw the disc as normal including updates made after the freeze occurred. The disc array maintained the frozen image until the backup was complete, guaranteeing a true snapshot as at a specific instant in time.

      I believe that LVM on Linux makes it possible to create a snapshot of the volume. But I never had the chance to test it.

      Robert

      --
      Bastard Operator From 193.219.28.162
    10. Re:What I'd really like... by nettdata · · Score: 3, Informative

      A few years ago I saw a neat (expensive!) disc array that could 'freeze' the disc image at a single point in time so that a backup could be taken from the frozen image.

      We used to do this years ago before any such "options" were provided by drive manufacturers.

      We were doing large Oracle backups, and there were issues with taking too much time to do a backup.

      What we did was to throw some extra drives into the (at the time, software) RAID, so that we had a mirror of what we wanted to backup. At backup time, we'd shut down the Oracle instance, break the mirror, and then re-start the Oracle instance. The whole procedure resulted in less than 2 minutes of downtime for the instance, which was more than acceptable. We'd then take the "broken" mirror, re-mount it under a "temp" mount point, and then take our time backing it up (it usually took about 6-8 hours). Once we were finished backing it up, we'd then re-attach the broken mirrors and re-silver it. This was all done via software RAID, before journalling was available.

      We did this about once a week, and it worked out great.

      --



      $0.02 (CDN)
    11. Re:What I'd really like... by mikerubel · · Score: 1
      MadAndy,

      As several have pointed out, LFS can freeze a volume, though I haven't played with it. Note that normally the reason we're worried about data changing out from under us is that with a conventional backup strategy (such as dump), the filesystem can be rendered inconsistent by such changes. Here, the worst that happens is a few files are messed up--you don't lose the whole backup. So maybe it isn't as important?

      If you have a serious application and can't afford to lose a single transaction, you should consider something more solid (and expensive!). This is just a hack for office-type use. :)

      Enjoy!

      Mike

    12. Re:What I'd really like... by Anonymous Coward · · Score: 0

      The Enterprise Volume Management System (EVMS) http://evms.sf.net offers a generic snapshot feature with rollback support, writeable snapshots and asyncronous I/O that allows you to not only snapshot LVM devices but any block device that EVMS supports.

  40. Parasites by Anonymous Coward · · Score: 0

    Why should slashdot offload their traffic to google?
    Make your own damn mirror, parasites.

  41. Not snapshots by Florian+Weimer · · Score: 5, Informative

    The method Mike describes does not create snapshots, so you can't use it to create consistent backups: Files can be written while they are read by rsync, and lots of software (including databases) requires cross-file data consistency (some broken software even expects permanent inode numbers!). rsync can be used for backups (if you trust the algorithm), but in most cases, you have to do other things to get a proper backup.

    At home, I store xfsdump output encrypted with GnuPG on an almost public (and thus untrusted) machine with lots of disk space (on multiple disks). At work, I do the same, but the untrusted machine is in turn backed up using TSM. In both cases, incremental backups work in the expected way. Of course, all this doesn't solve the snapshot problem (I'd probably need LVM for that), but with the encryption step, you can more easily separate the backup from your real box (without worrying too much about the implications).

    1. Re:Not snapshots by mikerubel · · Score: 2, Informative
      These are not snapshots in the sense of LVM or NetApp; they do not freeze the whole filesystem at a particular point in time between atomic transactions. This technique is a hack for something like a small-office file server. It helps deal with accidental deletions or overwrites, which seem to account for the majority of restore jobs. Think of it as an easier and more intuitive replacement for tar-to-tape. If you're running a database where every transaction counts, you'll need to spend the money and buy a more reliable system!

      Mike

  42. why get so complex? by ywwg · · Score: 3, Funny

    if [ `df |grep /mnt/backup |wc -l` != "1" ]
    then
    echo Backup drive not mounted, skipping procedure
    exit 2
    fi
    cd /mnt/backup
    rsync -vaz --exclude-from=/root/exclude $1 $2 $3 $4 $5 / .


    where exclude =
    /mnt/cdrom /mnt/usb /mnt/backup /mnt/abyss1 /mnt/abyss2 /proc /tmp


    stick in a cronjob. you can also add --delete if you want. it's basic, but easy.
    1. Re:why get so complex? by p3d0 · · Score: 2

      Want to know why so complex? READ THE ARTICLE. It's explained quite clearly.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  43. ATTN: YOU FORGOT THE PROFANITY by Anonymous Coward · · Score: 0

    Hey PF, that post was just sarcastic, and didn't have one curse word in it except the signature.

    This is not the level of performance your fans have come to expect.

    PLS FIX, K THX

    1. Re:ATTN: YOU FORGOT THE PROFANITY by Anonymous Coward · · Score: 0

      The correct abbreviation for Profane Motherfucker is PMF. Just for future reference.

  44. Who's that "Linus" guy anyway? by Anonymous Coward · · Score: 0

    Just because his name sounds like "Linux" doesn't mean his opinion is any better than the average slashdotter.

    1. Re:Who's that "Linus" guy anyway? by Anonymous Coward · · Score: 0

      If you had used any other demographic, you'd be right. The fact is that the "whiny, self-satisfied social malcontent" demographic doesn't have much weight to throw around, aside from that contained in its average 55" waist. Seeing as how Slashdot is the infamous center of such a "social" collection and how Linus has actually done something in this world, yes, his opinion is better and more important than any of yours.

  45. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  46. be gentle? by robpoe · · Score: 1
    Please try to be gentle on his server: it is the $80 computer that he mentions in the tutorial.

    ... Slashdotted!!!

    Did anyone else think to themselves..I'm gunna click on that link just because it said go easy on it?

    #!/bin/sh rm -Rf /SAVE/bkup.tar.gz.5 mv /SAVE/bkup.tar.gz.4 /SAVE/bkup.tar.gz.5 mv /SAVE/bkup.tar.gz.3 /SAVE/bkup.tar.gz.4 mv /SAVE/bkup.tar.gz.2 /SAVE/bkup.tar.gz.3 mv /SAVE/bkup.tar.gz.1 /SAVE/bkup.tar.gz.2 mv /SAVE/bkup.tar.gz /SAVE/bkup.tar.gz.1 tar -zcf /SAVE/bkup.tar.gz /etc /var/spool/mail /home /var/www

    Then I have an FTP script that runs once per day on the OTHER server sitting there (dare I say, the MS box) that grabs the BKUP.TAR.GZ from the linux box..And does much the same as far as replication.

    --
    = Grow a brain...
  47. at WHAT time in the morning? by TheGratefulNet · · Score: 2
    at 4.20? is that right? the tutorial he included on rsync alluded to this.

    I guess its better to trust your server at 4.20 than the operator. well, for many operators that is. even if its 4.20pm, I'd still prefer to let the machine do the critical work instead of some sysadmins. knowing what I know about many sysadmins at 4.20 that is..

    [hint: double entendre on 420. not sure if the author knew this or not. or maybe I just stated what was terribly obvious.]

    --

    --
    "It is now safe to switch off your computer."
  48. I use by Anonymous Coward · · Score: 0

    I use Alan Cox as my Linus backup. He makes it easy too.

  49. Flexbackup by tzanger · · Score: 2

    I don't consider snapshot backups backups; they're snapshots.

    I've been using a utility called Flexbackup -- it's a perl script which will do multi-level backups (i.e. incremental), spew to tape or file, use tar, afio or dump and compression. Oh yes, and it will use rsh/ssh for network backups. I wish I could buy the author a beer or few but it seems to be unsupported now. Oh well.

    Email me if you want a copy and can't find it. I've also got a patch to fix a minor table of contents bug with modern versions of mt.

    1. Re:Flexbackup by p3d0 · · Score: 2
      I don't consider snapshot backups backups; they're snapshots.
      Care to explain the difference for the uninitiated? Why can't a "snapshot" serve the same function as a backup?
      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    2. Re:Flexbackup by Cool+E · · Score: 1

      you may be interested in this. it does backups via rsync over ssh. its still in development so i'm sure features can be added if users request them.

    3. Re:Flexbackup by tzanger · · Score: 2

      you may be interested in this [bentlogic.net]. it does backups via rsync over ssh. its still in development so i'm sure features can be added if users request them.

      It's got the exact same basic problem that the backup method featured in this article has -- they're snapshots, not multi-level backups. Each "pull" is a complete copy; I can't say "Give me all the files which have changed since my last levelx backup." That's what Flexbackup (well tar or afio) allows me to do. That's exactly what rsync isn't designed to do, as far as I can tell (I've used it before but I'm not an expert at it).

    4. Re:Flexbackup by tzanger · · Score: 2

      Care to explain the difference for the uninitiated? Why can't a "snapshot" serve the same function as a backup?

      I didn't say it couldn't serve as a backup, but it's not a backup in the sense that I can keep the last 6 months' worth of changes and pull from any of them. With snapshots I need to either keep 6 months of full daily backups or postprocess the daily snapshots and turn them in to differential backups.

      An example might help. I do daily backups of our servers. Let's call the daily backups level 3 backups. Now each week I do a level 2 backup. Each month I do a level 1 backup, and every quarter I do a level 0 backup. Let's analyze:

      • Level 0 - full backup, every quarter
      • Level 1 - Monthly backup, just changes from the last month's backup
      • Level 2 - weekly, just changes from last week's backup
      • Level 3 - daily, just changes from yesterday
        • I store the Level 0 backups on DVD-(+?)RW, and the rest on two 6-tape magazines. Level 1&2 on DDS3 IIRC, and Level 3 on DDS. I can pull back any file changed in the last quarter, just like someone could pull back a file from a particular day in CVS.

      With full snapshot backups this would take an insane amount of disk space. As I said earlier I could postprocess the snapshots and create differential backups but why do the extra work when tar/afio does this automatically? RSync isn't that special, and with an incredible script like Flexbackup it's even less special.

      It would be great if rsync could tell the other end "this file has changed, here are the changes" and have the backing-up end copy the file and apply the changes -- i.e. allowing the creation of differential backups. That's not what it's designed for, though.

    5. Re:Flexbackup by p3d0 · · Score: 1
      Thanks for the explanation. That makes a lot of sense.

      However, the linked article combines rsync with cp -al to get the effect you want. Have another look.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    6. Re:Flexbackup by haakon · · Score: 1

      It would be great if rsync could tell the other end "this file has changed, here are the changes" and have the backing-up end copy the file and apply the changes -- i.e. allowing the creation of differential backups.

      I hate to break it to you but that is what rsync does. If the file already exits where is is copying to it will send the delta (think diff but more efficant and works with binary files.) and only update the changes.

    7. Re:Flexbackup by tzanger · · Score: 2

      I hate to break it to you but that is what rsync does. If the file already exits where is is copying to it will send the delta (think diff but more efficant and works with binary files.) and only update the changes.

      You didn't read carefully enough. and have the backing-up end copy the file and apply the changes -- I don't want one snapshot, I want a base snapshot and then any changes to be saved in an entirely new tree structure.

      Basically this: Take your snapshot normally. Now ask for all the files that changed between the snapshot and today. rsync sends the diff. Now for each file mentioned in the diff, copy the entire file from the snapshot to another directory and apply the diff to that copy. Now your new directory has full files that are up to date, but only the diffs were sent over. That is not what rsync does.

  50. Except that rsync isn't particularly reliable. by Colin+Smith · · Score: 1

    Speaking from experience.

    --
    Deleted
  51. Are backups the right solution? by anthony_dipierro · · Score: 2

    It seems that it would be much more efficient if each application handled its own backup scheme. I don't need to backup my whole drive. Certainly not my mp3s or my applications.

    1. Re:Are backups the right solution? by Anonymous Coward · · Score: 0

      I don't need to backup my whole drive. Certainly not my mp3s or my applications.

      Are you nuts? Porn and my mp3s are the ONLY thing I need to backup. I don't care if I lose my browser cache or my OS as I can reinstall it, but porn and mp3s take years to collect. That's why I store them in at least two seperate locations (two different states actually!). If I were to lose my porn collection I would be quite sad. :-(

    2. Re:Are backups the right solution? by mikerubel · · Score: 2
      Anthony,

      You can exclude any part of the filesystem from the backups, or particular types of files, or files that match a particular pattern; see the "exclude" section in the rsync man page.

      I'm not sure I agree that applications should handle their own backups! Don't forget that applications are run as their owners, so if they are broken or hacked, they can destroy the backups too. Far better, I think, to have the backups removed where user-level processes can't touch them. And probably a lot simpler too!

      Mike

    3. Re:Are backups the right solution? by netsharc · · Score: 1

      If I were to lose my porn collection I would be quite sad. :-(

      Buddy, not meaning to insult you or anything, but that comment shows you're already a sad sad person..

      --
      What time is it/will be over there? Check with my iPhone app!
    4. Re:Are backups the right solution? by Anonymous Coward · · Score: 0

      You're right.. I'm naked right now jerking off to Jennifer Anniston porn. I'm pretty sure it is a fake though.

    5. Re:Are backups the right solution? by anthony_dipierro · · Score: 2

      You can exclude any part of the filesystem from the backups, or particular types of files, or files that match a particular pattern; see the "exclude" section in the rsync man page.

      I don't know about you, but my filesystem certainly isn't organized enough for that to be useful.

      Don't forget that applications are run as their owners, so if they are broken or hacked, they can destroy the backups too.

      Well, I was thinking more along the lines of backing up to a third party server over the internet, in which case there wouldn't be permission to delete old copies until after a certain period of time. I dunno, in the case of my system, there's very little that needs to be backed up. In fact, I really can't think of anything.

  52. Rsynch has a file count limit by goombah99 · · Score: 1

    The problem I've had with rsynch is that it seems to have a file tree size limit at which is spits up and fails. I dont know how to work around this. Yes I do do evil things like have 20,000 files in my direcories, but I have sound reasons for doing so not shear lazyness. Anybody know how to fix this

    --
    Some drink at the fountain of knowledge. Others just gargle.
    1. Re:Rsynch has a file count limit by Cool+E · · Score: 1

      I haven't ever seen this problem. I've seen rsync take a really long time trying to build the file list, but never break because of too many files. I backup large amounts of files via rsync every day.

  53. Hard links and file diffs? by p3d0 · · Score: 2
    I'm wondering what happens to the hard links when rsync decides it only needs to update part of a file. If it is guaranteed to write a brand-new file with the merged changes, that's good. If, on the other hand, it changes the backup file in-place, then all the older backups that are only hard links will also see those changes, and that's a Bad Thing.

    Anyone know anything about this issue? I can't find the necessary info in the rsync docs.

    Judging by the fact that this technique does seem to work, I presume that rsync never modifies a file in-place, but I wonder if that's a guarantee, or just the current behaviour?

    (Also, I am aware of the --whole-files command-line argument, but that's an orthogonal issue.)

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    1. Re:Hard links and file diffs? by ewen · · Score: 1
      I'm wondering what happens to the hard links when rsync decides it only needs to update part of a file.

      I wondered about the same thing too. Given he reports permissions getting changed for older versions, I wonder if the contents of older copies also get changed.

      I do my space efficient multiple levels of (online) backups the other way around: rsync the backup into a snapshot (not a true snapshot, but close enough on the systems I do it on), and then run a script that compares the previous snapshot and the new snapshot and links identical (contents, permissions, etc) files together.

      I also generally keep a current directory which has an exact rsync copy of the thing being backed up, and back that up to tape regularly -- the snapshots are just there for easy online recovery. Doing this has greatly reduced the need to recover from tape, but it is nice to know the option to do so is still available.

      Ewen

  54. Amusing coincidences... by sterno · · Score: 1

    Well, funny this should come up as I just got my new backup drive yesterday and was going to sit down to write a backup script. Thanks! :)

    --
    This sig has been temporarily disconnected or is no longer in service
  55. The answer? by p3d0 · · Score: 2
    I just found the answer looking through Mike Rubel's source code:
    # step 4: rsync from the system into the latest snapshot (notice that
    # rsync behaves like cp --remove-destination by default, so the destination
    # is unlinked first. If it were not so, this would copy over the other
    # snapshot(s) too!
    I wonder how he discovered this? I can't find it in the man page.
    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    1. Re:The answer? by mikerubel · · Score: 2, Interesting
      I wonder how he discovered this? I can't find it in the man page.

      Rsync source code, then a lot of testing! :)

      Mike

      ps: You're right, if there is any change in the file, the original is unlinked first, then the new one is written over top of it. So it does work as advertised! Thanks for your help answering questions btw.

    2. Re:The answer? by p3d0 · · Score: 1

      Thanks for the confirmation. I wonder, could you ask the rsync guys for a hard-link friendly "--unlink-for-all-changes" option that would guarantee the semantics you need?

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  56. backpack! by meff · · Score: 1

    A little plug for my own script, to make personal backups.. Gained its name because it selectively only backs up directories you specify and ignores those you specify also. I use it to create a selective backup of my system, leaving out things I backup seperately like music, etc.. and I usually can make it end up with a 400-500mb iso of just system dirs with conf's, the kernel source, and my home dirs with all configurations in tact. Some example files are included.

    Take a look if you're interested :)
    Click on "backpack"

    -r

  57. CVS, cron, and an RW by Screaming+Lunatic · · Score: 2
    That's what I'm using at the moment. I use a cron job to throw all my important directories into my repository every night. Then I burn it onto an RW.

    This works because I don't throw my mp3/ogg, pr0n, etc into the repository. I'll have to figure out a new solution when I hit the 650MB/800MB limit, but it works for now. I'll probably just have my repository on a different computer and use ssh or a get another HD speciffically for backup purposes.

    I started using this system after reading the Pragmatic Programmer. They recommend throwing using CVS for everything that is important. It's great for more than just code. And this way, whenever I install a new distro, I have all my settings since I save my .emacs, .mozilla, .kde, .etc directories.

  58. rsync is the best, until you need compression by freest · · Score: 1

    rsync has faithfully served my backup needs for many a year, but recently I've needed to conserve disk space and fell back to tar because I couldn't find any way to run rsync on a compressed backup to update it... the closest thing I found was to patch the kernel for a compressed filesystem support and then run rsync on that... any tips anyone?

  59. not that great. by 7-Vodka · · Score: 1
    Why go through all this work when you could just use raid? I mean, he recommends to get a second "slightly larger" hard disk anyway.

    no no no, what I want, is a DVD burner that holds a stack of dvds and automatically burns them, then dumps them into storage for me.

    --

    Liberty.

    1. Re:not that great. by _Shorty-dammit · · Score: 1, Informative

      because raid isn't going to give you a file in the form that it was in 3 days ago, it's only going to safeguard your current data. The point here is to give you a backup as well as access to data as it was yesterday or the day before.

    2. Re:not that great. by Anonymous Coward · · Score: 0

      Why go through all this work when you could just use raid? I mean, he recommends to get a second "slightly larger" hard disk anyway.

      Haven't you ever done "rm file*" and went "SHIT! I forgot I need file2"? I have. I don't even know what I was thinking when I typed it. With a BACKUP solution you can go restore it, with RAID it happily and merrily deletes it from both disks at the same time. Lovely!

  60. Suggestions for Win32? by ScroP · · Score: 1

    Anyone have any solutions for creating win32 backups w/o an expensive commerical package?

    1. Re:Suggestions for Win32? by Anonymous Coward · · Score: 0

      Start - Run - ntbackup.exe

    2. Re:Suggestions for Win32? by mikerubel · · Score: 1
      Hi Eric,

      I use this very technique to back up a Win2K machine. Mount the relevant shares with Samba, and have my linux box keep the snapshots.

      Mike

    3. Re:Suggestions for Win32? by Anonymous Coward · · Score: 0

      PKZip command line version. Write a batch file.

    4. Re:Suggestions for Win32? by erikaaboe · · Score: 1

      There is a good procedure to do scheduled network backups onto a Linux box here -

      http://www.linuxjournal.com/article.php?sid=4360

      It has worked well for me.

      Erik

  61. chattr +u by steveha · · Score: 2

    As others have noted, you can get snapshots using LVM.

    What I would really like, however, is the ability to have the file system keep versions of a file as the file is written to or deleted; I don't want a shapshot every hour, I want a new single-file snapshot for every change to the file. And I want to be able to set or clear an attribute to control which files/directories this gets done in (i.e., chattr +u, which currently doesn't really do anything). And I want the old snapshots to age and vanish on their own, say, 3 days after they are made (or however many days the sysadmin chooses).

    Under Windows, with Norton Utilities, you can get this sort of functionality with the Norton Protected Recycle Bin. I have been wishing for this on Linux for quite some time.

    I remember reading about something called the "Snap filesystem" which would someday offer this, but I can't find anything about it now on the web.

    steveha

    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
  62. Re:Win2k has free backups made easy, too! by Enahs · · Score: 2
    Really. And backing up via "samba" preserves file permissions and file ownerships properly?



    I'd like to hear from you on this subject.

    --
    Stating on Slashdot that I like cheese since 1997.
  63. Re:Win2k has free backups made easy, too! by Profane+Motherfucker · · Score: 1

    I don't know, I've never tried it. I use rsync.

  64. simple encrypted backup by Anonymous Coward · · Score: 0

    the only downside is that you need to feed a password:

    tar cvzf - $1 | ssh $2 '( cd $3; tar xvzf - )'

    ssh_backup dir host host_dir :O

    1. Re:simple encrypted backup by kcurrie · · Score: 2, Informative

      the only downside is that you need to feed a password:

      Not if you use the ssh-agent, and maybe keychain.
      Before you run that command in a script, put this code previous to it:

      keychain -q /root/.ssh/id_dsa
      . /root/.ssh-agent-box750
      tar cvzf - $1 | ssh $2 '( cd $3; tar xvzf - )'

      Now the first time you run the command, it will ask you for your key passphrase, but any subsequent runs will work passwordlessly.

      I use a similar script with rsync and it works great. Set up a cron job to automatically do the backup, and once after the box boots start a manual bkup (thus loading the key), and it'll work automatically from there.

      Keychain can be found here: http://www.gentoo.org/projects/keychain.html

      --
      -- I speak only for myself.
    2. Re:simple encrypted backup by dossen · · Score: 1

      Keychain is indeed a great tool, it really makes ssh shine.
      In fact it even works on winblows, using cygwin.
      I use it all the time to synchronise files via cvs.

    3. Re:simple encrypted backup by Cool+E · · Score: 1

      First, tar is not reliable.

      Second, you could use ssh keys.

      Third, look here for something that already does this.

  65. 4:20 by Sean+Clifford · · Score: 2
    You're right, 4:20 is a good time to do this. Let the system do the work for me while the sysadmin has a toke^H^H^H^H smoke. :)

    IMHO, this is a great solution - I've been looking for something like this for fuss-free backups at work. Viola.

    Being the only "computer guy" at work sucks ass when you're the programmer/sysadmin/engineer/tech. Gah.

  66. What about backups to tape ? by Fred_A · · Score: 2, Interesting

    Backing up to your disk is all very good agains errors of manipuation, but what if the disk fails?

    And what about people like me who backup to a DLT (or whatever) tape drive? Not much use then either.

    In any case I don't see this as being extremely useful in the real world (i.e. beyond the casual backing up of a home machine)...

    --

    May contain traces of nut.
    Made from the freshest electrons.
    1. Re:What about backups to tape ? by mikerubel · · Score: 1
      Tapes can fail too, of course. :)

      The intent is not to substitute for tapes, but to supplement them. This technique makes the most common types of restore operations very easy (so that users can do it without admin assistance), and means you might not have to make backup tapes as often. When you do make backup tapes, you can pull them from a weekly snapshot, so that you're guaranteed the filesystem doesn't change while the tape is being written!

      Mike

    2. Re:What about backups to tape ? by Cool+E · · Score: 2, Insightful

      Hard drives come out as being much cheeper than tape even in the long run.You don't need removable disks, you just need to have the machine in a different building if possible. A tape library to hold the amount of data that I need to hold would be over 5K and then I would have to buy tapes which are around $100 a peice, that doesn't seem very economical to me being that for less money I can build two 1TB, and yes thats a T for terabyte, backup systems and put them both in separate buildings. That way if one completely fails I still have all of my backups.

  67. i've been slashdotted! by mikerubel · · Score: 4, Interesting
    This slashdotting comes as a bit of a surprise; many readers have sent me improved scripts that I haven't quite gotten around to posting yet. I'll try to put them up later this weekend when the slashdotting dies down.

    The site was never down; it's just that my roommate, a windows user, noticed the connection was slow and reset the cable modem. He's quite upset about being unable to play Warcraft III. :)

    I've never had a slashdot nick before, so I just created this one today. I'll try to go through some of the comments and provide useful feedback.

    Thanks for your interest everyone!

    Mike

    1. Re:i've been slashdotted! by soloport · · Score: 3, Funny

      I know that listing my actual backup configuration here is a security risk; please be kind and don't use this information to crack my site. However, I'm not a security expert, so if you see any vulnerabilities in my setup, I'd greatly appreciate your help in fixing them. Thanks!

      First suggestion: Don't list your actual backup configuration.

  68. Re:Win2k has free backups made easy, too! by mikerubel · · Score: 1
    Not to be rude, but I don't think you read the article. This is a very different trick. I also use the technique to back up a Win2K machine, via Samba.

    Mike

  69. I was going to suggest cpbk but the web page seems to have disappeared. I hope someone else has the source for this because all I bothered to download was the RPM.

    Here is part of the man page that describes cpbk:

    Backup Copy is basically a smart copy program that allows
    a user to copy mass files from one place to another. When
    coping over a previous copy, the key features will allow
    coping only of new or non existing files in the backup.
    This results in saving time and less load on the drive.
    Built into the same feature of copying new files only, is
    a file removal procedure. If a file is removed from the
    source path, the same file will be removed when the next
    backup is performed. This provides a backup that is
    exactly the same as the source without filling up the
    drive. As an added option, all files that will be over-
    written or deleted when doing a copy over a previous
    backup, have the opportunity to be stored in a trash bin.
    You can leave this trash bin to grow and grow just in case
    you need a backup of your backup. When you start running
    out of disk space you will need to remove or clean up the
    trash bin.


    It's dead simple to use. Just cpbk srcdir destdir and all files in your backup directory (including subdirectories) are updated to the latest version in the source directory and deleted files are removed and so on.

    Slick as all hell.

    --
    If you're a zombie and you know it, bite your friend!
    1. Re:cpbk by innocent_white_lamb · · Score: 1

      I just found a working source download for this: http://ftp.debian.org/debian/pool/main/c/cpbk/cpbk _4.1.0.orig.tar.gz.

      --
      If you're a zombie and you know it, bite your friend!
  70. Re:rdist can perform same task with more flexibili by mikerubel · · Score: 1
    Nice! Actually, you get dated backup directories and "except" clauses (via the rsync --exclude or --exclude-from directives) with this trick too.

    Mike

  71. Backups? by CoderByBirth · · Score: 1

    I do it BOFH-style.
    1.2 seconds, no hassle with tapes:
    backup * > /dev/null

  72. But how do you do cron+ssh+rsync? by badzilla · · Score: 1

    I like rsync and it works great over ssh. But there seems to be no way to run rsync as a cron job because it will hang asking for the ssh password. Keys and ssh-agent seems like the solution - until you try it and find that don't work with cron :(

    --
    "Don't belong. Never join. Think for yourself. Peace." V.Stone, Microsoft Corporation
    1. Re:But how do you do cron+ssh+rsync? by kcurrie · · Score: 1

      See my post below where I mention using keychain. Basically if you have an agent loaded, you can easily attach to it in a cronjob (by sourcing a file that sets a couple of variables) and do what ever you want.

      --
      -- I speak only for myself.
    2. Re:But how do you do cron+ssh+rsync? by SCHecklerX · · Score: 2
      I like rsync and it works great over ssh. But there seems to be no way to run rsync as a cron job because it will hang asking for the ssh password. Keys and ssh-agent seems like the solution - until you try it and find that don't work with cron :(

      Use an RSA key with no password. If you are paranoid enough to be using ssh, you should be paranoid enough to be using the strong authentication provided by using RSA Keys.

      You don't really need ssh-agent.

    3. Re:But how do you do cron+ssh+rsync? by Cool+E · · Score: 1

      You might want to look at this. Its just something I've been working on.

  73. Re:Win2k has free backups made easy, too! by Anonymous Coward · · Score: 0

    Yes, it does actually, unlike rsync without the -ogp options. Since ms backup sees the volume as a normal ntfs shared folder, it seems three users, and all their rights and happily backs it all up.

    As for the ease of restore with ms backup, I think that's non-existant.

  74. WHAT ABOUT RESOURCE FORKS? by goombah99 · · Score: 1

    You have to be careful on macs in my experinece. simply copying all you mac files to another unix file system can sometimes loose the extra stuff in mac files like resource forks and creator codes. I'm not an expert on this, but macs have the unix command "ditto" (see man ditto) which is like 'cp' but takes care of that extra stuff. I dont know what rsynch would do.

    --
    Some drink at the fountain of knowledge. Others just gargle.
  75. That's pretty half-assed by Anonymous Coward · · Score: 0
    I just got home from the office today, setting up a CD-RW-based backup system, and I was disappointed after initially seeing the article title.

    Hard drive backups aren't backups at all. They are a half-assed solution for those too lazy or cheap to use a real solution like tapes or CD-RWs. Even if you keep your hard drive disconnected from your machine, you still aren't safe. What if your hard drive mechanicals fail? You'll still have your data (maybe), but you'll have to pay thousands to a data recovery company to get your data back. Contrast this situation with CD-RWs or tape, where the media is separate from the drive. If your CD or tape drive fails, it shouldn't be too much of a problem to just go out and buy another one or get it replaced under warranty. You'll still have your backups safe on one or more tapes (usually more, since most wouldn't use the same tape or CD for backups every day of the week, so you'd have several slightly more out of date ones to work with if your most recent one is hosed).

    If you look at things this way, tape and CDs especially come out much cheaper than multiple removable hard drives. I'm fairly sure even the most ludicrously-priced tape cartridges are cheaper than hard drives of equal capacity.

    1. Re:That's pretty half-assed by Cool+E · · Score: 1

      First, where are you getting all of this money for tape? I want some. Second, CD-RW are not praticle for backing up large amount of data and neither are DVD-R disks. I have to backup 0.5TB of data and yes thats a T as in terabyte. Therefore disks work much better. I just have a 1TB raid5 arry with one hot spare that cost under 5K to backup systems.

      Third, hard drive come out as being much cheeper than tape even in the long run.You don't need removable disks, you just need to have the machine in a different building if possible. A tape library to hold the amount of data that I need to hold would be over 5K and then I would have to buy tapes which are around $100 a peice, that doesn't seem very economical to me being that for less money I can build two 1TB, and yes thats still a T for terabye, backup systems and put them both in separate buildings. That way if one completely fails I still have all of my backups.

      Fourth, I really want to see you try to fit 0.5TB, and yes again thats a T for terabyte, on a CD-RW. Just let me know when you manage to do that.

  76. Improved cronjob with weekday names for backups by Anonymous Coward · · Score: 0

    #!/bin/sh -e
    # Assumes the existence of ${DIR_BKUP_ROOT}/{Sunday,Monday,Tuesday,Wednesday, Thursday,Friday,Saturday}

    DIR_DATA="/etc"
    DIR_ BKUP_ROOT="/backups"

    RM="/bin/rm"
    CP="/bin/cp"
    RSYNC="/usr/bin/rsync"
    DATE="/bin/date"

    [ -x $RM -a -x $CP -a -x $RSYNC -a -x $DATE ] || exit 1

    TODAY=`$DATE +%A`

    case "$TODAY" in
    'Monday')
    LASTNIGHT="Sunday"
    PREVBACK="Saturday"
    ;;
    'Tuesday')
    LASTNIGHT="Monday"
    PREVBACK="Sunday"
    ;;
    'Wednesday')
    LASTNIGHT="Tuesday"
    PREVBACK="Monday"
    ;;
    'Thursday')
    LASTNIGHT="Wednesday"
    PREVBACK="Tuesday"
    ;;
    'Friday')
    LASTNIGHT="Thursday"
    PREVBACK="Wednesday"
    ;;
    'Saturday')
    LASTNIGHT="Friday"
    PREVBACK="Thursday"
    ;;
    'Sunday')
    LASTNIGHT="Saturday"
    PREVBACK="Friday"
    ;;
    *)
    echo "ERROR: Invalid day!"
    exit 2
    ;;
    esac

    $RM -rf ${DIR_BKUP_ROOT}/$LASTNIGHT
    $CP -al ${DIR_BKUP_ROOT}/$PREVBACK ${DIR_BKUP_ROOT}/$LASTNIGHT
    $RSYNC -a --delete ${DIR_DATA}/ ${DIR_BKUP_ROOT}/${LASTNIGHT}/

    exit 0

  77. Email messages shouldn't change at all. by Dwonis · · Score: 2

    You should be using maildirs

    1. Re:Email messages shouldn't change at all. by Anonymous Coward · · Score: 0

      No, you shouldn't. Maildir solves a problem that doesn't need solving, and it is much, much slower than just about any other mailbox format.

    2. Re:Email messages shouldn't change at all. by Electrum · · Score: 2

      No, you shouldn't. Maildir solves a problem that doesn't need solving, and it is much, much slower than just about any other mailbox format.

      Really? How do you safely modify or delete a message from an mbox file? You make a new file and copy the existing one while changing the data that you need changed and then atomically replace the original file. This means you use double the space of the mbox file and take the time to rewrite the entire file. Or, you modify the original mbox file and hope the system doesn't crash while doing so or you risk corrupting the entire thing. And you have to deal with locking in both cases. How is this better than Maildir?

      As for being slow, there are benchmarks to prove you wrong (on courier-mta.org).

  78. what's the big deal? by Anonymous Coward · · Score: 0

    as a newbie unix admin, i figured this out 1.5 years ago.. big deal.. move along now...

    1. Re:what's the big deal? by s88 · · Score: 2, Insightful

      Cuase he doced and shared it; you didn't, thats the big deal.

  79. Why not just use Stitch. It sets up rsync for you. by Cool+E · · Score: 1

    Have you ever wanted to do backups easily and cheaper than tape? Well then Stitch is the answer for you. Use the features of rsync without the hassle of setting it up. This is not meant for data center scale backups, but for small departments or institutions. A mirror of the page can be found here. You don't have a client side, all thats required is ssh on the client. This way there isn't a client side to maintain. It does incremental backups on a monthly rotation and allows you to easily restore systems.

  80. As a Canadian.. I am sorry... by RebelTycoon · · Score: 0, Offtopic

    Hopefully this stupid survey conducted by Ipsos-Reid will not cast doubt on the importance I see of a strong and supportive partnership with our brothers to the south.

    Quoting, Seven in ten (69%) Canadians think that the United States, because of its policies and actions in the Middle East and other parts of the world, bear some of the responsibility for the terrorist attacks on them, while 15% indicate that they believe that the U.S. bears all of the responsibility.

    The question is overly broad and thus meaningless, additionally the timing is both inconsidered and just a cheap way of creating news by bashing Americans. Supporting a soverign nation (Israel) in its struggle for acceptance and a right to exist, and deploying military forces in Saudi Arabia when asked, does not constitute a justification for the cowardly act of September 11th.

    For more information, here is an article, but more importantly, I think we should all Ipsos-Reid what we think of their "make news bullshit by bashing Americans" at ...

    John Wright
    Senior Vice-President
    Ipsos-Reid Public Affairs
    (416) 324-2900

    To my American brothers, I am sorry for this type of survey, see to it that Ipsos-Reid doesn't do it again... Take the time, even if it is just a two-word email!

    1. Re:As a Canadian.. I am sorry... by Cool+E · · Score: 1

      This has absolutely nothing to do with this thread and should be moderaleted down to -1

  81. size limits by goombah99 · · Score: 1

    Size problems I've run into with Apple Software Restore (4GB limit) and Rsych (appears to have either a file count limit or a directory tree depth limit) are concerns. Can you say if this new rsynch has removed this limit, or if psynch has it?

    --
    Some drink at the fountain of knowledge. Others just gargle.
  82. Funny you should ask by Sits · · Score: 1

    Linus says dump is deprecated. Although I hear that patches have been added to make it stable in the most recent 2.4.x kernels.

  83. rsync-backup - a similar approach by wstearns · · Score: 2, Informative

    I have a similar script called rsync-backup. This one does automatic daily snapshots, works over ssh, and uses rsync and hardlinks (to save space), chroot, and an ssh forced command for security.

    --
    Mason, Buildkernel and more: http://www.stearns.org/
  84. Re:Rsynch has a file count limit and bigtime bugs by trevmar · · Score: 1

    I have been working all night trying to figure out why rsync keeps crashing my server. Yes, compiled and installed 2.5.4 (supposedly stable).

    I am backing up from /dev/hda1 to /dev/hdc1
    After 6 reboots and 12 fsck I finally got a complete image on /dev/hdc1 and now I actually get an error message (and clean error exit) saying:

    building file list ... done
    var/log/
    var/log/boot.msg
    var/log/boot.oms g
    var/log/httpd/
    var/log/httpd/access.combined.8 sep02.log
    var/log/httpd/access.combined.log
    var/ log/httpd/error_log
    rsync: error writing 4 unbuffered bytes - exiting: Broken pipe
    rsync error: error in rsync protocol data stream (code 12) at io.c(464)
    rsync: error writing 70 unbuffered bytes - exiting: Broken pipe
    rsync error: error in rsync protocol data stream (code 12) at io.c(464)

    A quick search of Usenet on Google shows the same problem reported twice in June 2002. How buggy is rsync? Anybody else (besides us three) have stability problems? ..Trevor..

  85. Re:Rsynch has a file count limit and bigtime bugs by commanderfoxtrot · · Score: 1

    I encountered similar errors using rsync. It was a while ago and I really can't recall the exact error codes, but the problem was a lack of disk space on the receiving machine.

    --
    http://blog.grcm.net/
  86. Re:Rsynch has a file count limit and bigtime bugs by Cool+E · · Score: 1

    That error doesn't say that its not completing the backups because of too many files. It sounds like you are running out of space.

  87. Re:Rsynch has a file count limit and bigtime bugs by trevmar · · Score: 1

    C'mon guys,
    I haven't admitted making a mistake like 'out of space' for years- Not since I started writing Linux columns for BYTE.com -lol

    I have been trying to work the problem out with the rsync mailing list. Every second message I receive tells me its my kernel or my hardware - sheez.

    Anyway - rsync v2.5.5 no longer crashes the server (THIS IS A KNOWN BUG IN 2.5.4 - can you believe that? The 'fork' bug - too many forks while executing rsync as root will bring down all open processes)(thanks to Paul Haas for that info)
    I now have a consistent and repeatable rsync failure. Whenever it tries to copy /var/log/httpd/access.combined.log

    I guess it doesn't like having to argue with Apache over who has the log open -lol ..Trevor..