1753916 Members
8403 Online
108810 Solutions
New Discussion юеВ

Auto FTP (.netrc)

 
Braithwaite
Occasional Contributor

Auto FTP (.netrc)

I need to update 100+ workstations with a new mountpoint.
I need to unmount the old mountpoint, rename the directory and mount to a new server mount point, and preferably update the entry in the /etc/fstab file to ensure a correct mount on a reboot.
Is this possible to achieve from a .netrc file. If so, how?
There's always somebody out there who knows
5 REPLIES 5
Santosh Nair_1
Honored Contributor

Re: Auto FTP (.netrc)

The .netrc file only allows you to automate ftp. You can not umount or mount filesystems through ftp. You'd have to set up .rhosts on the various machines so that you can run remsh commands. This makes scripting much much easier as you can run commands from one machine to be executed on remote machine(s). The downside is that remsh commands are very insecure. You might also want to consider ssh (www.openssh.com) which allows you to do similar things but is much more secure.

Hope this helps.

-Santosh
Life is what's happening while you're busy making other plans
David Lodge
Trusted Contributor

Re: Auto FTP (.netrc)

Not really. The .netrc file is design to allow passwordless FTP connections - FTP is for transfering files, not for running programs.

Alternatively, the FTP server on HP-UX does allow the command 'SITE EXEC' which should let you execute programs on the system, but I've never been able to get this to work.

dave
A. Clay Stephenson
Acclaimed Contributor

Re: Auto FTP (.netrc)

Hi:

FTP (Automated or not) will not do this. You need to script up a set of remsh commands but that only works well if you have set up the permissions. If I were you I would rethink the problem and look at setting up the automounter with NIS (or better still NIS+) automount maps.
It's more work this time but any changes in the future would be very easy and essentially instantaneous.

Clay
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Auto FTP (.netrc)

Hi:

Consider this:

Compose a script to do the bulk of your work. Open a telnet session to each workstation, in turn; 'rcp' the script to the workstation; execute the script, exit and move to the next workstation.

Regards!

...JRF...
Braithwaite
Occasional Contributor

Re: Auto FTP (.netrc)

Hi all, thanks for responses. I now know its not possible to do from a .netrc file, and have and easy option(James) and one I need to read up on(Clay). I think I'm OK from here.

Cheers

Kevin
There's always somebody out there who knows