LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-13-2014, 07:25 PM   #1
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 447

Rep: Reputation: 28
examples of automation in linux in general


Hi guys.

I know scripts are used to automate tasks
But what sort of tasks would you automate?

I can think of a few...
Backups
User login personalization
Clearing log files
Security

But what else is automated on industry level servers?

Thanks
 
Old 07-14-2014, 07:48 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,087
Blog Entries: 10

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Report generation; taking a large body of data and arranging it into a usable manner for someone.
 
Old 07-14-2014, 09:00 AM   #3
kbnuts
Member
 
Registered: Apr 2014
Posts: 45

Rep: Reputation: Disabled
pxe builds using kickstart,
pci hardening
 
Old 07-14-2014, 09:28 AM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,026

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
lets say you work in car insurance and you have a member db2 database to load on a mainframe with 2 million members and because of queue restraints you can only load 100,000 at a time. you can either set your alarm to wake up every hour between midnite and 6am.

or you can create an ftp script (albeit insecure since it has embedded username/password -- mainframe doesnt provide ssh) and schedule it via cron.
 
Old 07-14-2014, 11:08 AM   #5
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,158
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
Quote:
Originally Posted by sigint-ninja View Post
But what sort of tasks would you automate?
Anything I have to type more than 3 times in a day.
 
1 members found this post helpful.
Old 07-14-2014, 11:26 AM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Creating LXC containers, deploying software over the network, software building, basically (as Habitual already pointed out) anything that involves typing (more than one command) and has to be done more often.
Not only makes scripting your work faster, but also less error prone (if done right, of course).

Last edited by TobiSGD; 07-14-2014 at 11:27 AM.
 
Old 07-14-2014, 01:19 PM   #7
SteveH_66
LQ Newbie
 
Registered: Feb 2012
Posts: 16

Rep: Reputation: Disabled
scripting

I came across this thread and got curious about something. I am new to Linux and I am planning to try out a few different distros to see which one I like, I've already tried Mint and I liked that one. But one thing I dread with trying out new distros is every time you switch distros you're going to have any programs you had installed in the first distro disappear. Would it be possible to do a script so that when you got into a new distro you could have it automatically download and install the packages you had on the other one, so you don't have to go through the installation procedure a bunch of times? Thanks
 
Old 07-14-2014, 02:23 PM   #8
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,087
Blog Entries: 10

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Quote:
Originally Posted by SteveH_66 View Post
I came across this thread and got curious about something. I am new to Linux and I am planning to try out a few different distros to see which one I like, I've already tried Mint and I liked that one. But one thing I dread with trying out new distros is every time you switch distros you're going to have any programs you had installed in the first distro disappear. Would it be possible to do a script so that when you got into a new distro you could have it automatically download and install the packages you had on the other one, so you don't have to go through the installation procedure a bunch of times? Thanks
I'm not aware of any clean and automated way to do this, I follow some processes on my own to maintain continuity. You may want to check out this thread How long do you stick with a particular distro? there's some discussion there about what person's do WRT hopping from distribution to distribution.

The way I migrated was I booted via LiveUSB thus allowing me to install onto the USB things I needed to accomplish my functional mirroring, and I also keep my data on separate drives from my installation. I noted the alterations I had to make on the Live distro to get it doing all I needed/wanted from my old and then when I did a full wipe/install I knew the things to install/set-up and also knew how to do those things in the event that they weren't all simple tasks.
 
Old 07-14-2014, 03:10 PM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Quote:
Originally Posted by SteveH_66 View Post
I came across this thread and got curious about something. I am new to Linux and I am planning to try out a few different distros to see which one I like, I've already tried Mint and I liked that one. But one thing I dread with trying out new distros is every time you switch distros you're going to have any programs you had installed in the first distro disappear. Would it be possible to do a script so that when you got into a new distro you could have it automatically download and install the packages you had on the other one, so you don't have to go through the installation procedure a bunch of times? Thanks
It depends on what distros you're switching between and what programs you're installing. If you're talking about building from source, you could script that, but you would need to add a bunch of error handling since the library versions would differ and you could run into problems on certain distros. If you're talking about installing from the standard repos, you script pretty much all of that, provided you stick to distros with the same package manager (apt, yum, zypper, etc.).
 
Old 07-14-2014, 03:41 PM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Quote:
Originally Posted by SteveH_66 View Post
I came across this thread and got curious about something. I am new to Linux and I am planning to try out a few different distros to see which one I like, I've already tried Mint and I liked that one. But one thing I dread with trying out new distros is every time you switch distros you're going to have any programs you had installed in the first distro disappear. Would it be possible to do a script so that when you got into a new distro you could have it automatically download and install the packages you had on the other one, so you don't have to go through the installation procedure a bunch of times? Thanks
This is indeed possible, providing that you switch between distros that have the same base distro (for example, both are based on Ubuntu), so that package names are consistent between distros and the same package manager is used, and of course provided that the installed packages are available in both distributions (for example, the Mint tools are not available in Ubuntu's repositories).

So, it is quite simple to get a similar setup on KWheezy and Debian, but trying to do the same when switching from Debian to, for example Gentoo is far from trivial.
 
Old 07-14-2014, 03:46 PM   #11
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 447

Original Poster
Rep: Reputation: 28
Thats excellent info from all thanks...so how do i exercise scripting on a couple of servers running slackware and a few laptop workstations? can anybody give me a good example on what i could be doing to become more familiar or should i pick up a good book on say ...python scripting?
 
Old 07-14-2014, 04:10 PM   #12
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,774
Blog Entries: 1

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Well,.. if you are comfortable programming, then Python is a good start. (I suggest 'fabric' for automation in python http://www.fabfile.org/) But if not, Bash is the command shell most GNU/Linux distro's use, and it is indispensable to know how to use it.

Luckily there are hundreds of Bash resources, the more famous beginner version being this:

http://www.tldp.org/LDP/Bash-Beginners-Guide/html/

And the advanced information for Bash is here:

http://tldp.org/LDP/abs/html/

Last edited by szboardstretcher; 07-14-2014 at 04:12 PM.
 
Old 07-14-2014, 04:11 PM   #13
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Python is more than a "simple" scripting language, it is a fully fledged programming language that can be used for much more than writing some automation scripts. While you can use Python to automate system maintenance and automation (and there is nothing wrong with it if you do), usually Bash is used for that type of tasks.

If you want to learn Python, go ahead, the Python website is full of tutorials and links to freely available books, Python is a powerful language.
If you want to learn Bash instead (and don't get me wrong, you can write quite complex programs with it, look for example at Slackware's package management tools or installer) have a look here: http://tldp.org/LDP/abs/html/
It contains all you need to start Bash scripting.

What you actually try to automate is up to you, begin with something simple that you want to automate and just go ahead. If there are questions not covered by the documentation, the Programming subforum at LQ is full of knowledgeable and helpful people.
 
Old 07-14-2014, 07:14 PM   #14
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,831
Blog Entries: 36

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
As others have suggested automation takes many shapes and forms as to what is automated. In regards to what language you should use I'd say become familiar with a variety of languages (to an expert level) such as bash, awk, Python/ruby to name a few. Bash is more than just bash. It is the entire coreutils toolset as well as any program that properly reports POSIX standard exit codes. The power is not only in bash itself but also in the plethora of tools it can be used to execute.

Here's a thread I like to point people who want to know more about system administration.

http://www.linuxquestions.org/questi...8/#post5033506

When you get a few languages under your belt you'll begin to infer the strengths and weaknesses of each language. When you get to that point you'll know how to use the right tool for the job.

SAM
 
Old 07-15-2014, 04:43 PM   #15
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 447

Original Poster
Rep: Reputation: 28
I know what you guys have said, and what your opinions on certs are...just wondering if RHCSA is an entry level certification...it appears to be. and as pointed out earlier,i dont expect to get a job with a cert...i just want to study with a goal in mind...while getting practical experience as a hobbyist.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Useful netcat examples on Linux LXer Syndicated Linux News 2 01-27-2014 04:07 PM
Your automation ideas with Linux x111 Linux - General 1 08-09-2010 10:04 PM
Linux installation automation reshmpv Linux - Desktop 3 08-21-2008 09:33 AM
Automation tool for linux laphlaw Linux - Software 1 05-04-2007 03:39 PM
Document Automation in Linux??? JaseP Linux - Software 7 04-07-2004 01:23 PM


All times are GMT -5. The time now is 02:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration