LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-01-2008, 11:16 AM   #1
Hasjardl
LQ Newbie
 
Registered: Apr 2008
Posts: 2

Rep: Reputation: 0
Scripting Examples Wanted


Hi, I'm a computer science professor and I'm fairly new to the linux world. I'm going to be teaching an Intro to Fedora 8 class in a few weeks, and I just finished a potential scripting project for my students.

So, if possible, would any of you mind reading over my specifications and showing me how you would script this? Try to just imagine you're one of my students, with a very amateur level of skill. And try as hard as possible to stick exactly to the specs please =)

Project 2: backup script

In your second project you need to develop a backup shell script that allows a user to backup selected directories.

In the first part of the project, you should write the script itself. The backup script should do the following:

* it takes two arguments: the name of the directory to which you need to save backup file and a name of the file with the list of directories that the script needs to backup.
* the script should check
o the number of arguments and print the usage message if not all arguments are provided
o that the backup directory is in fact a directory
o that argument file is a readable file
* if all needed arguments are given, the script should
o within the specified backup folder create a sub-folder named backup_today's date. For example, if the script is run on March 14, 2008, the sub-directory name should be backup_2008-03-14
o read the contents of the argument file and compress each given directory into its own file. Please use the tar command for the compression. If the name of the directory to backup is for example /home/daniel the created file should have a name home-daniel.tar.gz. Hint: use the tr command to transform the slash symbols '/' into dashes '-'.
o This file should be created in the new backup directory the script just created.



I'd really appreciate any help/feedback you could give =D
 
Old 04-01-2008, 11:21 AM   #2
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
Good Source of Examples

Linux Shell Scripting with Bash
Ken O. Burtch
Sams Plublishing
ISDN 0-672-32642-6
www.developers-library.com
 
Old 04-01-2008, 11:27 AM   #3
Hasjardl
LQ Newbie
 
Registered: Apr 2008
Posts: 2

Original Poster
Rep: Reputation: 0
I appreciate the direction, but I'm looking for people to actually script the small project and show me their example. I'd like to have various examples to show my students after they take a stab at the project themselves.
 
Old 04-01-2008, 11:41 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Hasjardl View Post
I'm a computer science professor
Yes. And I am A. President of Vice.


Quote:
Originally Posted by Hasjardl View Post
I just finished a potential scripting project for my students.
Show us!


Quote:
Originally Posted by Hasjardl View Post
Project 2: backup script
What was project one if I may ask?


Quote:
Originally Posted by Hasjardl View Post
Try to just imagine you're one of my students, with a very amateur level of skill.
What have you got against amateurs? They can be fscking skilled as well! Heh.
Just show us how much work you put into giving them a quality intro into scripting.
If you can't or didn't then doesn't this actually sounds like homework in disguise?
 
Old 04-01-2008, 11:51 AM   #5
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Forgive my cynicism, but this seems like a very transparent ploy to get people to do homework for you.
 
Old 04-01-2008, 08:35 PM   #6
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Calvin (as in Calvin and Hobbes) calling the reference librarian: "Allo! I am beeg important German Professor studying curse words in English. Can you tell me all the curse words you know?"

(apologies to Mr. Watterson, I couldn't find the original to get an exact quote.)
 
Old 04-03-2008, 09:48 PM   #7
mdhmi
Member
 
Registered: Dec 2005
Location: Detroit, Michigan
Distribution: Ubuntu
Posts: 86

Rep: Reputation: 15
Post the script you wrote in its entirety and I'm sure a few people will chime in if this is legit. Which language? perl? bash? ksh?
 
  


Reply



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
Examples of PCRE library in C Centinul Programming 11 09-27-2010 05:13 AM
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 04:29 AM
scripting guru wanted (low pay but emotionally rewarding) dasbooter Programming 9 08-16-2005 06:49 PM
IPTables examples? tarballed Linux - Security 7 12-27-2002 10:07 AM
FYI: need some more iptable examples? unSpawn Linux - Security 1 04-24-2002 12:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:53 PM.

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
Open Source Consulting | Domain Registration