script problem with smbclient and put - SMB

This is a discussion on script problem with smbclient and put - SMB ; Hi there I'm trying to do a filetransfert from a unixbox to windows server 2003 with smbclient like this : smbclient //10.0.0.10/temp -W MYDOMIAN -U user%"password" -N -c "prompt; put toto.txt" del toto.txt But can I test if the file ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: script problem with smbclient and put

  1. script problem with smbclient and put

    Hi there

    I'm trying to do a filetransfert from a unixbox to windows server 2003 with
    smbclient like this :

    smbclient //10.0.0.10/temp -W MYDOMIAN -U user%"password" -N -c "prompt; put
    toto.txt"
    del toto.txt

    But can I test if the file was transfert with sucess befor deleting it ?


    Thanks in advance for any help


    Ralf




  2. Re: script problem with smbclient and put

    Ralf Meuser wrote:

    > Hi there
    >
    > I'm trying to do a filetransfert from a unixbox to windows server 2003
    > with smbclient like this :
    >
    > smbclient //10.0.0.10/temp -W MYDOMIAN -U user%"password" -N -c "prompt;
    > put toto.txt"
    > del toto.txt
    >
    > But can I test if the file was transfert with sucess befor deleting it ?
    >
    >
    > Thanks in advance for any help
    >
    >
    > Ralf


    Just an idea but you could do this is stages like this:

    1. Transfer toto.txt
    2. Rename local toto.txt to toto.txt.loc
    3. Read back toto.txt from 10.0.0.10
    4. "md5sum" or "diff" the two toto files.
    5. If they're the same - transfer worked!
    6. If they're different or toto.txt didn't exist on the remote machine,
    rename the local toto.txt.loc back to toto.txt, rinse and repeat.

    I'm not sure whether/if smbclient has error codes you could possibly
    interpret after the transfer (non-zero == some sort of problem), but the
    error-code route would save the second transfer/read-back.

    James
    --
    The bogosity meter just pegged.


+ Reply to Thread