Currently i am Using A shell script to ftp to a Nt Server from where i am getting the files & after loading i am Archieving that file to a diffrent folder
on the same Nt server & then Again using a shell script to delete the file from the original location.
Now the problem with me is that i am manually making the file as read only after Archieving that, i want to implement this using shell script too.
is their any way i can implement that in shell script ,chmod command i ve already tried but that dont wotk On ftp prompt any other way to make file as read only.
kduke wrote:You have to do it after ftp is done. chmod is not a command within the ftp command.
its Ok That mean i have to do it manually their is no way to automate this
through data stage coz ftp stage doesn't support any such options of changing file permissions.
As long as the remote server allows it, there are the 'Telnet before' and 'Telnet after' commands available inside the FTP stage. Setup the 'after' session to log in and issue the chmod command.
-craig
"You can never have too many knives" -- Logan Nine Fingers
chulett wrote:As long as the remote server allows it, there are the 'Telnet before' and 'Telnet after' commands available inside the FTP stage. Setup the 'after' session to log in and issue the chmod command.
Hi craig can u tell me exactly wat should i specify in that option to change the permission or should i directly fire that chmod command in telnet after session option.
chulett wrote:The same series of steps you would have to do if you were telnet'ing into the box after the ftp and changing the permissions yourself.
But the problem here is when i try to telnet that server from command prompt its says Could not open a connection to host: Connect failed.
Might be server was not configured for recieving incoming telnet sessions. .Is their a way of doing it through some script.
Archieving i am doin just by Ftp>ftp stage so its just creating a similar copy to another folder then after completing this job i am deleting the file from original location by using shell script ,in that i am using delete command to delete the file [#!/bin/sh
HOST=$1
USER=$2
PASSWD=$3
cmmurari wrote:you can use command stage in server jobs
See the exact problem of mine in the beginning i know i can use command stage for shell script my problem is that how can i change file permission if i archieve a file to some other folder
i want to make it read only after successful transfer.
I have seen some ftp that suppport umask for the target files.
But most ftp implementations support some kind of local shell capability, so you can say something like this in your ftp script after the files have been recieved.
....
get $filename
....
! chmod 111 $filename
....
clshore wrote:I have seen some ftp that suppport umask for the target files.
But most ftp implementations support some kind of local shell capability, so you can say something like this in your ftp script after the files have been recieved.
....
get $filename
....
! chmod 111 $filename
....
Check the documentation for the ftp on your host.
Carter
Hi Carter Thanks for reply
But still i am in problem my ftp server is on NT box & ds server is unix
so by command ! chmod it takes me back to unix prompt again & as error i get can't access file one more thing i want to tell you that i can not telnet
the ftp server too & with these conditions i have to change file permissions.