[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] OT: FTP from Command line



> -----Original Message-----
> From: cobalt-users-admin@xxxxxxxxxxxxxxx 
> [mailto:cobalt-users-admin@xxxxxxxxxxxxxxx] On Behalf Of 
> William J.A. Brillinger
> Sent: Wednesday, November 19, 2003 3:53 PM
> To: cobalt-users@xxxxxxxxxxxxxxx
> Subject: Re: [cobalt-users] OT: FTP from Command line
> 
> 
> At 12:37 AM 20/11/03 +0800, you wrote:
> >Ligard, Vidar wrote:
> >>>Greetings!
> >>>
> >>>I have a shell script on my RaQ4 that FTP's a bunch of files to 
> >>>another
> >>>server like this:
> >>>
> >>>------------------------
> >>>d=$(date +%Y-%m-%d)
> >>>
> >>>ftp -i ftp.server.tld <<**
> >>>cd /mydirname
> >>>mkdir $d
> >>>chmod 600 $d
> >>>cd $d
> >>>binary
> >>>mput *
> >>>ls -x1A
> >>>bye
> >>>**
> >>>------------------------
> >>>
> >>>I need it to also chmod the files that it transfers to 600 but I 
> >>>can't
> >>>seem to get that to work.
> >>
> >>Looks like your chmod command is setting permissions on the 
> directory,
> >>not the files themselves
> >>-Vidar
> >
> >how about a
> >chmod -R 600 %d/*
> >recursively sets the contents of directory $d to 600 (or get 
> rid of the 
> >-R)...
> 
> 
> chmod -R 600 $d/*
> chmod -R 600 /*
> chmod 600 $d/*
> chmod 600 *
> chmod 600 /*
> 
> The above commands do not work :(
> gives: ?invalid command
> 
> for i in $( ls -x1A ); do
> chmod 600 $i
> done
> 
> also does not work. The loop gives an appropriate number of "?Invalid 
> command"'s followed by: "(file-name) done: No such file or directory"
> 
> I'm stuck. there has to be a way to do this.

What commands work is not only dependent upon the ftp client. It can also be specific to the FTP server. I.e. Microsoft's FTP server works different from Mac's FTP server, etc. Even the different open source server may implement the FTP standard differently.
I don't know what ftp server you are attempting to connect to, but you may be able to get the result you want by setting the 'umask' option in the configuration file for the server.
This specifies what permissions a file has by default when you upload it.
With proftpd you can even specify different umask for different directories.
I believe you would want umask 077 to prevent all permissions for group and the world.

HTH,
Vidar
> 
> - Bill
> 
> - Bill
> 
> 
> 
> ---------------------------------
> William J.A. Brillinger
> Precision Design Co.
> 
> E-Mail:   mailto:billy@xxxxxxxxxx
> Web site: http://www.pdcweb.net
> 
> _____________________________________
> cobalt-users mailing list
> cobalt-users@xxxxxxxxxxxxxxx
> To subscribe/unsubscribe, or to SEARCH THE ARCHIVES, go to: 
> http://list.cobalt.com/mailman/listinfo/cobalt> -users
>