Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > Your Distro > Redhat / Fedora Linux Help > Cronjob assignment

Forgot Password?
 Redhat / Fedora Linux Help   Help and discussion related to Redhat and Fedora Linux.

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 2 Weeks Ago   #1 (permalink)
Just Joined!
 
Join Date: Oct 2009
Posts: 2
Cronjob assignment

Hey Linux pros!

I'm currently taking a course which includes Linux however the teacher is terrible at delivering the content and I've done my best to decipher this assignment. Maybe I could find better insight from users like yourselves. This is NOT a direct copy/paste of my assignment, I did alot of cleaning up. Anyway, here we go :

----------------------------------------------------------------------------------------------
Linux II – Assignment II Understanding

PART 1

Create this cronjob :

- Create a file in root's home directory.
- Make that file list all other files that have the setuid bit.
- Only capture good output. No error messages.
- This happens once a month on the first day.

- Give the file a descriptive filename and include date info : Month, Week, Day as part of the filename.
- Everytime the file is created log the action to a separate log file named /var/log/rootadmin
- Use facility “user” for logging.
- Message must be descriptive and contains date/time, host and pid.

- Extract – using grep – the log entries of the scheduler that pertains to the job you created and save it as a file name ~root/cronlog

-----------------------------------------------------------------------------------------------------

Now, I'm not asking for someone to actually do it for me. no.no. I simply wish for help getting started and maybe help me understand what I'm doing. So far, our teacher has VERY briefly touched on Cron and my understanding is quite limited at this point.

Thanks in advance!

-JD-
JDArcand is offline  


Reply With Quote
Old 2 Weeks Ago   #2 (permalink)
Linux Enthusiast
 
Kieren's Avatar
 
Join Date: Aug 2007
Location: England
Posts: 730
The first thing you need to do is create a script that "list all other files that have the setuid bit." Don't worry about cron for this part

Once you have created that script you then need to use crontab to run the script at the specified times

Once you have done that you can edit your crontab again to output your script's output to the logfile

Finally you can use grep on the log file to search for all the input from your script

Hope this helps you out a bit!
__________________
Linux User #453176
Kieren is offline   Reply With Quote
Old 2 Weeks Ago   #3 (permalink)
Just Joined!
 
Join Date: Oct 2009
Posts: 2
Thanks Kieren for your advice! I would absolutely create a script to do this however I cannot for 2 reasons I failed to mention before :

1. She said this can all be accomplished with 1 command that includes command substitution.

2. I'd have to learn scripting :P (We're not that far yet )

I'm devoting the next 3 days on this project to fully understand Cron and command substitution. I'll periodically come back here and post my obstacles.

Thanks again!
JDArcand is offline   Reply With Quote
Old 2 Weeks Ago   #4 (permalink)
Just Joined!
 
Join Date: Nov 2009
Posts: 4
you can use the find command to get a listing of all files with the setuid bit
boardjnky4 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 05:51 PM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2