[Tutor] Simple Linux Admin1, New guy looking for some tips.

orbitz at ezabel.com orbitz at ezabel.com
Sat Feb 7 12:59:12 EST 2004


I doubt you will find a tutorial so specific, but you don't even need one.  When
createding anything there are a series of steps you follow to solve the problem.
First you should define as specificially as you can what the problem is.  Then
look at what tools you will need to solve this problem.  Read up on how to use
the tols, and finally put them all together.  A specific example of how to solve
specific tasks wouldn't really do you much good in the long run, monkey see
monkey do. If you learn to think for yourself you will be much better off.


On Fri, 6 Feb 2004 22:21:23 -0800
Joshua Banks <syn_ack at comcast.net> wrote:

> WARNING: Unsanitized content follows.
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> 
> Sorry, I hope my long windedness doesn't scare you away from reading my 
> thread. :)
> 
> As I read, read, and re-read through allot of the python tutorials I'm 
> finding some stuff is starting to sink in. Its only been a few days so 
> I don't expect miricales.  Putting Python to work is another story 
> though. Heh. Heh.
> 
> I have an idea of some of the simple linux admin things that I would 
> like to do with Python. What I'm not finding is tutorials based on 
> using python to do simple linux admin tasks. 
> 
> Maybe I shouldn't say "admin" I only use acouple of Gentoo linux 
> machines on my local network. In an effort to best facilitate the way 
> that "I learn" am asking for some help as well as any links that are 
> geared towards using Python for some of the simple linux admin tasks 
> with explanations of what the python code is doing from step A to Z 
> when scripting those said tasks. Googling finds some stuff here and 
> there but nothing with explanations or Python linux tutorial driven I 
> guess.
> "As soon as I gain some more experience I plan on creating my own 
> mini-Python linux tutorial for newbies like myself"
> 
> In the mean time I would like to take some really small baby steps and 
> put forth a few simple examples of the "admin" thingee's that I'm 
> referring too and start learning. 1 example for now anyways.
> 
> 
> 
> 
> 
> Example:........(And I know that this can be done very simply using 
> other means besides Python)
> 
> .......Everytime that Gentoo linux compiles a package there's a log file 
> created of that said compilation for each package compiled. If a 
> package breaks or fails I can reference that specific log and try and 
> find out where it failed or broke or what caused the problem. These are 
> also nice to have if an engineer would like to see them. These specific 
> logs are stored in "/var/log/portage directory"
> 
> This directory is going to become very big, fast.
> 
> "ls -la in the /var/log directory shows portage with:"
> drwxrwsr-x    2 root     portage      4872 Feb  5 08:16 portage
> 
> root at fusion1 log # du -ah
> 7.1M    ./portage
> 
> Since these logs are "only occasionally" used for referencing I would 
> like to compress all the log files in this directory when seen fit and 
> have a subdirectory created in the "parent portage" directory to store 
> compressed files. Kinda like a "Portage log Archive" I guess.
> 
> 
> 
> 
> 
> So hopefully the following is a good starting baby step to learning some 
> Python.  :P
> 
> Specifically, I would like to accomplish the following with a Python 
> script.
> 
> 1) Compress all files located in "/var/log/portage/" (not sure which 
> compression utility is the best for this case)
> 
> 2) Create a subdirectory located within the Parnet "portage" directory 
> called "LogArchive", and place the compressed files from the "portage" 
> directory into newly created subdirectory "LogArchive".
> 
> #My Mental note: I would preferably like to compress all files together 
> if possible instead of individually. Not sure how that is best done 
> though. Maybe thats directory compression... Hmmmm.. never done that 
> before.
> 
> How do I do this with Python considering "#My Mental note:"? I will use 
> this example as a building point instead of jumping into the wxPython 
> stuff that my brother keeps trying to push on me.. I just don't want to 
> learn the GUI stuff until I feel alot more comfortable with Python 
> basic's. Concepts and Symantics.
> 
> Thanks bunches. :D
> 
> Joshua Banks
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
> 
> iD8DBQFAJIPjp9X7q/XgeyYRAsMjAJ9jnn5Jqa5R6CRnzEtxgx3CpnqyLwCgkABX
> kbrLIzF/5l+NokiHAyHOZ1I=
> =1cLE
> -----END PGP SIGNATURE-----
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list