Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CHMOD From FTP Batch File

Status
Not open for further replies.

Shilohcity

Technical User
Jul 12, 2000
136
GB
Hi there

I have a Batch file running on a Windows 2000 machine which copies files from a local directory to a directory on a UNIX Web Server. In order to make sure the files are synced between the two locations it first deletes all the files on the server. This is all working fine. My problem lies with the file permissions. When the files are deleted the newly FTP'd copies default to a rw- r-- --- setting when they need to be rw- r-- r--. It seems I can't use CHMOD from within the FTP file to change this. Does anybody have any suggestions of ways to change the permissions?


Cheers
Justin. "Creativity is the ability to introduce order into the randomness of nature." Eric Hoffer

Visit me at
 
Check the umask settings for the user ftp'ing the files.
umask
or
umask -S
Then man umask
HTH ;-) Dickie Bird
db@dickiebird.freeserve.co.uk
 
edit /etc/inetd.conf to add the following at the end of the ftp line : -u022
this will set the permissions to 644, since in that case the umask you specify (022) is subsacted form the top umask of 666 Too bad I.T. is not cash business

Luc Foata
Unix sysadmin, Oracle DBA
 
Thanks for your suggestions.

I have now got this going with some help from my ISP.

Cheers

Justin. "Creativity is the ability to introduce order into the randomness of nature." Eric Hoffer

Visit me at
 
from Solaris 'man ftpd':

in.ftpd 's umask (which it uses to create files during
PUT operations) may be adjusted by adding the line
UMASK=nnn

to /etc/default/ftpd.
vlad
+---------------------------+
|#include<disclaimer.h> |
+---------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top