ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
I just finished a potential scripting project for my students.
Show us!
Quote:
Originally Posted by Hasjardl
Project 2: backup script
What was project one if I may ask?
Quote:
Originally Posted by Hasjardl
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?
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
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.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.