Backup Windows Box on Linux Box via SMB?

Discussion in 'Linux Networking' started by Nomen Nescio, Dec 4, 2003.

  1. Nomen Nescio

    Nomen Nescio Guest

    I've got an XP machine and a linux machine that are connected across a fast
    ethernet network and TCP/IP + Samba.

    I've got directories and files on the Windows machine I'd like to have
    periodically "mirrored" on the Linux machine. Something along the lines of
    a crontab job that would run like at 3AM. It'd be great if it would only
    copy over the modified/changed/added files and not unchanged ones. This
    way, if my Windows machines hard drives ever take a dump, or I screw
    something up, I'll have copies of my important files on my Linux machine's
    HD.

    I'd like this to be implemented on the Linux machine, where the Linux
    machine initiates the process/runs the command and talks to the Windows
    machine, rather than running a "crontab" like job on the Windows machine
    and perhaps emailing me if there were any problems. I want the process to
    occur across samba/SMB, and not FTP or NFS.

    I looked at the "smbtar" and the "smbclient" commands, and it looks like it
    could be doable with those, but I'm wondering if there's a better way than
    with those...

    Is this easily doable?

    If so, could someone point to a relevant FAQ or explain the steps in a way
    that is easy to implement for someone who is not a UNIX guru.
     
    Nomen Nescio, Dec 4, 2003
    #1
    1. Advertisements

  2. Yes, use rsync (http://samba.anu.edu.au/rsync/)
    I use a modifed version of the sample scripts at

    http://rsync.samba.org/examples.html

    There is an explanation of incremental backups as well as many ideas for
    using rsync for backup at

    http://www.mikerubel.org/computers/rsync_snapshots/
     
    Ambarish Sridharanarayanan, Dec 4, 2003
    #2
    1. Advertisements

  3. Nomen Nescio

    Fokke Sukke Guest

    In case rsync isn't what you want, then maybe something like arkeia backup
    is something for you. It has a windows client which enables you to backup
    stuff periodically to a tape or file.
     
    Fokke Sukke, Dec 4, 2003
    #3
  4. You could mount the windows shares on your Linux box as normal, and
    just write a small script to "cp" the files from the share to the
    local drive?
     
    Mattias Honrendgard, Dec 4, 2003
    #4
  5. Nomen Nescio

    Steve Wolfe Guest

    I've got directories and files on the Windows machine I'd like to have
    Or even better, rsync'd: Even though you're using it to move files
    between two file systems which are both mounted on the machine (IE, the
    network transfer is still taking place over SMB), it would still be a good
    idea, as it will intelligently decide just which files need to be
    updated/moved. As network transfers are far slower than transfers to/from a
    local disk, on the second and subsequent runs, it'll greatly speed things
    up. It can be the difference between your backups taking a few minutes
    compared to a few hours.

    steve
     
    Steve Wolfe, Dec 5, 2003
    #5
  6. Nomen Nescio

    Noi Guest

    If a drive is mounted or mapped all the time. Then you could do it either
    from Linux grabbing the Win files or from Win writing files to Linux.

    I was using Window's Backup to backup Win2k files to a mapped
    Linux drive weekly, incremental on every other week to the same
    files on the mapped Linux drive. On the Linux box renamed the file
    when I wanted a generation or two of backup.

    If you smbmount the Win files you can make a list of files on the
    smbmounted Win drive to backup then use tar to backup the files.

    mount -t smbfs /win/shared /win/drive &&
    find /win/drive/ -type f -depth -mtime +1 > tar_includes &&
    tar -uf winbackup.$date2.tar -T tar_includes &&
    # where $date2 is a date scheme
    umount /win/drive &&
    bzip2 -z winbackup.$date2.tar &
     
    Noi, Dec 5, 2003
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.