[Use a script with Samba]

Nelson Garcia garcian002 at hawaii.rr.com
Tue Feb 13 18:32:08 GMT 2001


You could also use smbmount.

If you just want to copy files and directories, use ftp.  You can write an
'expect' script to do that.
Here's a sample I stole from http://www.rtr.com/newrtr/tech.xprogramer.htm

#! /usr/local/bin/expect --
#test on ftp
set timeout 60
spawn ftp ftp.rtr.com
expect "Name*:"
send "anonymous\r"
expect "Password:"
send "test at rtr.com\r"
expect "ftp>"
send "cd ReadyPaks\r"
expect "ftp>"
send "bin\r"
expect "ftp>"
send "get SamplePak.SSol2.RTR\r"
expect "ftp>"
send "quit\r"
expect "221 Goodbye.\r"
close
wait
send_user "Your file is here\n"

I have a script that uploads a webpage every 4 hours with my IP address (my
IP is dynamic).  I'm writing from work so I don't have the script with me.
However the above example should get you started.

I hope that helps.
Nelson

----- Original Message -----
From: "Yacketta,Ronald J" <YackettaRJ at worldkitchen.com>
To: <minh.dang-recalt at akazi.com>; <samba-ntdom at us5.samba.org>
Sent: Tuesday, February 13, 2001 07:58 AM
Subject: RE: [Use a script with Samba]


> why would you want todo this?
> you could use rsync, ftp, ncftp or a mired of other utilities
> that would make life easier on your
>
> Ron
>
> =>-----Original Message-----
> =>From: Minh Dang-Recalt [mailto:minh.dang-recalt at akazi.com]
> =>Sent: Tuesday, February 13, 2001 12:52 PM
> =>To: samba-ntdom at us5.samba.org
> =>Subject: [Use a script with Samba]
> =>
> =>
> =>Hello,
> =>
> =>I wonder if i can create a script on my linux Box to copy a
> =>directory to
> =>another Linux Box via Samba client ?
> =>I'm thinking a script like that :
> =>
> =>-------------
> =># bash shell
> =>cd /home/test -> On the local
> =>Linux Machine
> =>smbclient \\\\Linux2\\Shared password
> =>cd /home/TOTO -> On the
> =>remote Linux box
> =>put recurse * .
> =>exit
> =>-------------
> =>Of course, it doesn't work.
> =>Anyone has an idea to make it working ?
> =>
> =>Thanks !
> =>
> =>Minh
> =>
> =>
>





More information about the samba-ntdom mailing list