Message #5

2007-12-24 22:26:00

Alejandro,

This is simple, but works ....

#!/usr/bin/ksh
# creates $LOGNAME/.netrc using current env. vars
export LOG_FILE='/data/MakeNetRC.log'

cd $HOME # Change to $HOME
if test ! -f .netrc # If no .netrc, exit
then
exit
fi

echo '============================' >>$LOG_FILE
echo 'Begin ' `date +%m-%d-%Y` $LOGNAME >>$LOG_FILE
echo ' '`date +%H:%M:%S` >>$LOG_FILE
echo '============================' >>$LOG_FILE
mv .netrc old.netrc
echo 'machine <YOUR MACHINE>' >.netrc
echo 'login <YOUR $LOGNAME>' >>.netrc
echo 'password <YOUR PASSWORD>' >>.netrc
echo 'macdef init' >>.netrc
echo 'lcd <YOUR LOCAL DIRECTORY>' >>.netrc
echo 'cd <YOUR REMOTE DIRECTORY>' >>.netrc
...
ADD FTP Commands you wish to invoke here
...
echo 'quit' >>.netrc
echo '' >>.netrc
chmod 0400 .netrc
ftp -i<YOUR MACHINE>
chmod 0664 .netrc
mv old.netrc .netrc
echo '============================' >>$LOG_FILE
echo 'FTP process Complete ' `date +%m-%d-%Y` $LOGNAME >>$LOG_FILE
echo ' '`date +%H:%M:%S` >>$LOG_FILE
echo '============================' >>$LOG_FILE

codeprof-request at codeprof.com wrote:
>
> Send codeprof mailing list submissions to
> codeprof at codeprof.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://www.codeprof.com/execute/ask/?codeinfoid=12808
> or, via email, send a message with subject or body 'help' to
> codeprof-request at codeprof.com
>
> You can reach the person managing the list at
> codeprof-admin at codeprof.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of codeprof digest..."
>
> Today's Topics:
>
> 1. ADMIN NOTE: Archives search engine back up (Bill Bradford)
> 2. NIS slave can't talk across router to NIS master? (Walt Sullivan)
> 3. On the road to pruning wtmpx (Dennis Peterson)
> 4. Automated FTP session, please help with the .netrc file. (Redondo Escobar, Alejandro)
> 5. FTP session, please help with the .netrc file. (Redondo Escobar, Alejandro)
> 6. Help required how to clean / Proc (Santosh M Hulkund)
> 7. [Fwd: Re: Installing GCC] (Jean Berthold)
> 8. Re: SUMMARY DiskSuite install (Dan Barnes)
> 9. tcsh output: "couldn't set locale correctly" ? (Stots Haim)
> 10. Reinitialize installed patch record - Sol2.6 (ltiu)
>
> --__--__--
>
> Message: 1
> Date: Sat, 13 Apr 2002 12:18:23 -0500
> From: Bill Bradford <mrbill at mrbill.net>
> To: codeprof at codeprof.com
> Subject: ADMIN NOTE: Archives search engine back up
>
> The search engine for the list archives is back up! Sorry for the delay,
> but it took 2.5 days to do the complete initial indexing of ten years worth
> of email. I hope that second CPU arrives soon. 8-)
>
> http://www.codeprof.com/archives.html
>
> As always, contact me with any questions or comments or problems.
>
> Bill
>
> --
> Bill Bradford
> mrbill at mrbill.net
> Austin, TX
>
> --__--__--
>
> Message: 2
> Subject: NIS slave can't talk across router to NIS master?
> Date: Sun, 14 Apr 2002 02:07:03 -0400
> From: "Walt Sullivan" <Walt.Sullivan at meriton.com>
> To: "SunManagers (E-mail)" <codeprof at codeprof.com>
>
> Our internal network is 10.0.0.0/255.255.240.0 and contains our Solaris =
> 7 NIS master.
>
> We just installed a router to isolate our lab, and changed the lab IPs =
> to use the 10.0.16.0/255.255.240.0 network.
>
> I've set up a Solaris 7 NIS slave on the lab network, but it can't seem =
> to receive data from the NIS master on the internal network. The =
> master's yppush says "Status received from ypxfr on nisslave: Failed - =
> ypxfr couldn't get the map master's address." It's probably something =
> obvious, but I've been awake too long.
>
> How can I get the master and slave to communicate across the router?
>
> Thanks, will summarize.
>
> Walt Sullivan
> Unix System/Network Administrator
>
> Meriton Networks
> 3026 Solandt Road,=20
> Kanata, Ontario K2K 2A5
> walt.sullivan at meriton.com, walt at trytel.com
> (613) 270-9279 x262
> Fax: (613) 270-9628
>
> --__--__--
>
> Message: 3
> Date: Sun, 14 Apr 2002 00:18:36 -0700
> From: Dennis Peterson <dennispe at inetnw.com>
> To: codeprof at codeprof.com
> Subject: On the road to pruning wtmpx
>
> I've stumbled onto a puzzle:
>
> Sol8, using
>
> /usr/lib/acct/fwtmp </var/adm/wtmpx >/tmp/wtmpx.tmp
>
> Then...
> /usr/lib/acct/fwtmp -ic </tmp/wtmpx.tmp >/tmp/wtmpx.bin
>
> then...
>
> /usr/lib/fwtmp </tmp/wtmpx.bin >/tmp/wtmpx.ascii2
>
> Still far removed from rocket science at this point...
>
> then...
>
> diff /tmp/wtmpx.ascii /tmp/wtmpx.ascii2
>
> They're very different. In fact, they have no common records. Most notably, the
> years in the records of the wtmpx.ascii2 file is 1970. This is not what I
> expect. What I expect is that the two ascii files are identical. Here's the
> wheel, steer me toward the light.
>
> It was my intention to use the fwtmp utility to prune wtmpx files since it seems
> predestined to provide such a service, but 'tis not to be. Any ideas?
>
> dp
>
> --__--__--
>
> Message: 4
> Subject: Automated FTP session, please help with the .netrc file.
> Date: Thu, 11 Apr 2002 10:27:23 +0200
> From: "Redondo Escobar, Alejandro" <aredondo at indra.es>
> To: <codeprof at codeprof.com>
>
> Hi all codeprof!
> I am trying to make an automated ftp session each day under a crontab =
> job.
> I have read, in the manpages, that this task can be done using the =
> $HOME/.netrc... something like the FTP uses it like a macro (ftp =
> commands?)source... isn't it?
> Well I have been trying to work whit this file, and I have get no job =
> working. :-(=20
> Please could someone of you help me with this point, about what to =
> include in this .netrc file? Any example is really wellcomed!!
>
> This is my example .netrc file, I invoke it using "ftp -i =
> <machine_name>" command:
> -------------------------------------------------------------------------=
> ----
> ".netrc"
> machine bono login opertemp passwd ____
> ls
> bye
> -------------------------------------------------------------------------=
> ----
>
> The ftp command says:=20
> Error - .netrc file not correct mode.
> Remove password or correct mode.
>
> Thanks for all in advance.
>
> --__--__--
>
> Message: 5
> Subject: FTP session, please help with the .netrc file.
> Date: Thu, 11 Apr 2002 10:44:25 +0200
> From: "Redondo Escobar, Alejandro" <aredondo at indra.es>
> To: <codeprof at codeprof.com>
>
> Hi all codeprof!
> I am trying to make an automated ftp session each day under a crontab =
> job.
> I have read, in the manpages, that this task can be done using the =
> $HOME/.netrc... something like the FTP uses it like a macro (ftp =
> commands?)source... isn't it?
> Well I have been trying to work whit this file, and I have get no job =
> working. :-(=20
> Please could someone of you help me with this point, about what to =
> include in this .netrc file? Any example is really wellcomed!!
>
> This is my example .netrc file, I invoke it using "ftp -i =
> <machine_name>" command:
> -------------------------------------------------------------------------=
> ----
> ".netrc"
> machine bono login opertemp passwd ____
> ls
> bye
> -------------------------------------------------------------------------=
> ----
>
> The ftp command says:=20
> Error - .netrc file not correct mode.
> Remove password or correct mode.
>
> Thanks for all in advance.
>
> --__--__--
>
> Message: 6
> From: Santosh M Hulkund <santoshmh at indts.com>
> To: "Sunmanagers-Request (E-mail)" <codeprof at codeprof.com>
> Subject: Help required how to clean / Proc
> Date: Thu, 11 Apr 2002 18:56:23 +0530
>
> Hi Gurus,
> I have a query, how do u clean contents under proc directory
> in solaris 7. I tried restarting the server, but it didn't work.
>
> I randomly checked for the contents in the directory, of
> say, process id 403 under /proc and did an ls -alr
>
> dr-x------ 2 root root 800 Apr 11 17:13 .
> dr-x--x--x 5 root root 736 Apr 11 17:13 ..
> -r-xr-xr-x 1 root sys 154560 Jun 3 1999 a.out
> -r-xr-xr-x 1 bin bin 167492 May 20 1999 ufs.32.3.33969
> -r-xr-xr-x 1 bin bin 1159980 Jun 29 1999 ufs.32.3.34063
> -r-xr-xr-x 1 bin bin 4560 May 20 1999 ufs.32.3.34073
> -r-xr-xr-x 1 bin bin 8008 Sep 1 1998 ufs.32.3.34080
> -r-xr-xr-x 1 bin bin 19876 Sep 1 1998 ufs.32.3.34089
> -r-xr-xr-x 1 bin bin 825132 Jun 3 1999 ufs.32.3.34092
> -r-xr-xr-x 1 bin bin 56988 Sep 1 1998 ufs.32.3.34107
> -r-xr-xr-x 1 bin bin 184444 May 6 1999 ufs.32.3.34109
> -r-xr-xr-x 1 bin bin 17276 Jun 29 1999
> ufs.32.3.393483
>
> Here it shows the dates as 1999, since the data here is junk, i need
> to clean this files, is it safe for me to just run rm -rf under or is there
> any way to clean.
>
> Will Summarize.
>
> With Regards,
> Santosh M Hulkund
>
> --__--__--
>
> Message: 7
> Date: Fri, 12 Apr 2002 12:06:43 +0100
> From: jean.berthold at eos-gd.ch (Jean Berthold)
> Organization: EOS
> To: "codeprof at codeprof.com" <codeprof at codeprof.com>
> Subject: [Fwd: Re: Installing GCC]
>
> Ok ...
>
> Sorry for my newbie's question ...
>
> I tried to put the package to:
>
> root at zanzibar # cd /tmp
> root at zanzibar # pkgadd -d . gcc-2.95.3-sol8-sparc-local
> pkgadd: ERROR: no packages were found in </tmp>
> root at zanzibar #
>
> Then I tried the following syntax and that ok ...
>
> root at zanzibar # pkgadd -d /tmp/gcc-2.95.3-sol8-sparc-local
>
> The following packages are available:
> 1 SMCgcc gcc
> (sparc) 2.95.3
>
> Select package(s) you wish to process (or 'all' to process
> all packages). (default: all) [?,?,q]:
>
> Processing package instance <SMCgcc> from
> </tmp/gcc-2.95.3-sol8-sparc-local>
>
> gcc
>
> It's appear this is necessary to give the absolute pathname to install a
> package, that correct ?
>
> However, if I try to install a package from Solaris CD-ROM :
>
> cd /cdrom/cdrom0/.../Packages/.../
>
> and :
>
> pkgadd -d . my_package
>
> That function correctly, why ?
>
> Thanks again for your help and have a nice day !
>
> Jean Berthold
>
> -------- Original Message --------
> Objet: Re: Installing GCC
> Date: Fri, 12 Apr 2002 11:39:30 +1000
> De: "Broun, Bevan" <brounb at adi-limited.com>
> Rpondre-A: brounb at adi-limited.com
> A: Jean Berthold <jean.berthold at eos-gd.ch>
> Rfrences: <3CB5AF9B.7D6FD919 at eos-gd.ch>
>
> do:
>
> pkgadd -d /full/path/with/leading/slashes/gcc-2.95.3-sol8-sparc-local
>
> BB
>
> on Thu, Apr 11, 2002 at 04:45:31PM +0100, Jean Berthold
> <jean.berthold at eos-gd.ch> wrote:
> > Hello all,
> >
> > I need to install GCC compiler under Solaris 8.0
> > I downloaded the tarball :
> >
> > http://sunsite.cnlab-switch.ch/ftp/mirror/solaris-freeware/sparc/8/gcc-2.95.3-sol8-sparc-local.gz
> >
> > How to install that ?
> >
> > I tried gunzip this file and pkgadd ... but it seems this file is not an
> > Sun .pkg
> >
> > Thank you for your help and have a nice day
> >
> > Jean Berthold
> >
> >
> >
> > --
> > ________________________________
> >
> > Jean Berthold
> > EOS - energie ouest suisse
> > Chemin de Mornex 10 , CP 570
> > CH-1001 Lausanne , Switzerland
> > Tel. : +41 (0)21 341 24 58
> > Fax : +41 (0)21 341 20 49
> > E-Mail : jean.berthold at eos-gd.ch
> > ________________________________
> >
> >
> > _______________________________________________
> > codeprof mailing list
> > codeprof at codeprof.com
> > http://www.codeprof.com/execute/ask/?codeinfoid=12808
>
> --__--__--
>
> Message: 8
> Date: Fri, 12 Apr 2002 17:25:48 -0700 (PDT)
> From: Dan Barnes <barnesdan at yahoo.com>
> Subject: Re: SUMMARY DiskSuite install
> To: codeprof at codeprof.com
>
> WOW,
>
> Thankyou to the massive and quick responses. By a 0 to
> 50 vote SDS does NOT require X and in some cases runs
> better without. Thank you to all that responded on
> this one especially those that even submitted shell
> scripts for setup!
>
> Cheers!
>
> - db
>
> --- Dan Barnes <barnesdan at yahoo.com> wrote:
> > Does anyone know if SDS requires X? ie: can it be
> > installed on a very vanilla system?
> >
> > Thanks in advance.
> >
> > -db
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Tax Center - online filing with TurboTax
> > http://taxes.yahoo.com/
> > _______________________________________________
> > codeprof mailing list
> > codeprof at codeprof.com
> >
> http://www.codeprof.com/execute/ask/?codeinfoid=12808
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
>
> --__--__--
>
> Message: 9
> Date: Sun, 14 Apr 2002 16:16:19 +0300 (IDT)
> From: Stots Haim <haimz at elbit.co.il>
> To: codeprof at codeprof.com
> Subject: tcsh output: "couldn't set locale correctly" ?
>
> Hello all,
>
> when login as root to brand new Soalris 2.8
> i got this:
> couldn't set locale correctly
>
> what is this ?
>
> Regards Stots
>
> --__--__--
>
> Message: 10
> From: ltiu <ltiu at alumni.sfu.ca>
> To: codeprof at codeprof.com
> Subject: Reinitialize installed patch record - Sol2.6
> Date: Sun, 14 Apr 2002 07:42:44 -0700
>
> Hello,
>
> Here's the story:
>
> 1) Solaris 2.6
> 2) Fully patched
> 3) Accident - deleted some critical system files
> 4) Booted off install cd and mounted root partition under /a
> 5) Reinstalled system files from install cd
> 6) Now the system thinks it has patches already installed but
> 7) Critical system files are actually old ones
> 8) Trying to rinstall patches will result in system saying patch already
> installed
>
> HOW do I reinitialize the installed patch database/record so that I may
> reinstall all the patches again.
>
> Thanks.
>
> ltiu
>
> --__--__--
>
> _______________________________________________
> codeprof mailing list
> codeprof at codeprof.com
> http://www.codeprof.com/execute/ask/?codeinfoid=12808
>
> End of codeprof Digest

--
Scott Hereld
V.P. Engineering
TrackMaster - An Equibase Company
851 Fremont Ave. #109
Los Altos, CA 94024
(650)947-9020x112
mailto:scott at trackmaster.com http://www.trackmaster.com

Comments

Got something to say?

You must be logged in to post a comment.