//flex table opened by JP

Click to See Complete Forum and Search --> : nt batch file to unix?


new2
03-09-2001, 02:25 PM
Hi-

I am trying to automate a stupid process that we have to go through at work and trying to do it in a batch file. I can ftp the files from the cd rom / or hard drive to the unix machine in the batch program, not a problem. The problem that I have is with the permissions on the unix box after they are ftp'd, the have -r--r--r- permissions.
I have copied them to the local hard drive,
changed the permissions so that everyone has all the permissions and then ftp'd them, but still the permissions are -r--r--r-.

(This doesn't happen with interactive ftp and it is not anonymous ftp)

Anyone have any suggestions? Anyway to telnet, rlogin in a batch file to the unix box, change file permissions?

Thanks!

If you know of another board like this that may be a better place to ask this type of question, great.

Nighthawk
03-09-2001, 02:32 PM
The way to change permissions in UNIX is to run a command called chmod.

chmod (your perms)(group's perms)(world's perms)

chmod 775 will give you -rwxrwxr-x (you and your group can read, write, execute, and the world can read and execute).

chmod 755 will give you -rwxr-xr-x (you can read, write, and execute, your group and the world can only read and execute).

I couldn't set permissions on a UNIX server through an FTP connection on the command line, so I think you would have to set in your batch file (don't know the exact programming, but this is a rough guess)

ftp (hostname)
{login info}
put {filename}
quit
telnet {hostname}
{login info}
chmod 775 (or 755) {filename}
quit

new2
03-09-2001, 02:48 PM
so the telnet command from the batch file on nt doesn't bring up a window?

(for test) on the nt cmd.exe command line
I did a call telnet. It brought up a window. I assumed that it would do so through the batch file also.??? Guess I should have tested it in the batch file.
Currently my batch file just has
call ftp -s:file.txt
exit

(there may also be a -i switch that turns prompting off, can't remember since I am not at work).

The file.txt has the
open machine
username
password
cd
put
etc.

Thanks for the permission info. I usually work on unix, so my dilema was just getting there. I will try the telnet in the batch file when I return to work next week. I did try changing the permissions when I had ftp'd over, but you can't do that.
Hope the telnet window doesn't pop up.

new2
03-13-2001, 09:12 AM
telnet window pops up from the batch file.
How do you make telnet, non interactive?
pass parameters etc?

Thanks