Find the answer to your Linux question:
Results 1 to 4 of 4
I am trying to do a backup which include shares from windows machines, the problem is that some of the shares have spaces i.e. backup test and it is not ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2004
    Posts
    18

    trouble backing up windows shares


    I am trying to do a backup which include shares from windows machines, the problem is that some of the shares have spaces i.e. backup test and it is not working. I have tried using "backup test" and backup\ test but they don't seem to work either. Does anyone have any other ideas?

    PS. some of the shares are windows paths such as

    c:\docs and settings\local setting\application data ... etc

    Cheers,

    Dennis

  2. #2
    Just Joined!
    Join Date
    Jun 2004
    Posts
    18
    here is a copy of the script:

    [code]
    #!/bin/bash
    #this is the administrator account on the windows machines
    USERNAME1=administrator
    PASSWORD1=administrator_password
    #
    DRIVE=/root/backup
    #
    TARGET_MACHINE=laptop
    BACKUP_SHARE=backup test ***this is where the trouble lies***
    #
    mkdir $DRIVE/$TARGET_MACHINE
    cd $DRIVE/$TARGET_MACHINE
    #
    smbclient //$TARGET_MACHINE/$BACKUP_SHARE $PASSWORD1 -U $USERNAME1 -c "recurse;prompt;mget *;"
    #
    tar cvpz $DRIVE/$TARGET_MACHINE > $DRIVE/$TARGET_MACHINE.tar.gz
    rm -rf $DRIVE/$TARGET_MACHINE
    #

    Cheers,

    Dennis

  3. #3
    Linux Guru
    Join Date
    Mar 2003
    Location
    Wisconsin
    Posts
    1,907
    I think you either need to
    1) mount the drive, back up and then unmount, or
    2) use smbtar

    Jeremy
    Registered Linux user #346571
    "All The Dude ever wanted was his rug back" - The Dude

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    What exactly happens? Do you get any error messages or anything of that sort?

    Don't you think it would work better if you just mounted that share instead, though? Like this:
    Code:
    #/bin/sh
    
    if mount | grep -q /mnt/backup; then
        echo "backup is already in progress" >&2
        exit 1
    fi
    mount -t smbfs "//$TARGET_MACHINE/$BACKUP_SHARE" /mnt/backup -o "password=$PASSWORD1,username=$USERNAME1"
    (cd /mnt/backup; tar -cvp .) | bzip2 >"$DRIVE/$TARGET_MACHINE.tar.bz2"
    umount /mnt/backup

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •