LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-06-2003, 09:22 AM   #1
WarriorWarren
LQ Newbie
 
Registered: Apr 2003
Posts: 17

Rep: Reputation: 0
Unhappy Help creating a directory back up shell script


hi,

I am trying to create a shell script which backs up one directory to another. It should takes two parameters from the user, firstly the directroy to back and the directory to back up to. I then need the script to check if the directories are valid, if not output to user, and then to check if there will be any files over written in the process and to report these to the user with an option to overwrite or not.

Help would be greatly appreciated as this is an assignment that i have to do and im getting no-where fast.

Thanks all

Last edited by WarriorWarren; 04-06-2003 at 09:32 AM.
 
Old 04-06-2003, 09:37 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Rule number 1 in how to get other people to do your homework for you: do NOT tell them it is your homework:
Quote:
this is an assignment
do not ask homework questions on this site, work it out for yourself using the resources you should have been provided.
 
Old 04-06-2003, 09:43 AM   #3
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 464

Rep: Reputation: 52
Have you decided what shell you are going to write this script in? csh, tcsh, bsh, bash, ksh, ash, sh, or some other? In other words, have you written your first line of code? It is always a good first step.

If there is a choice in the matter, I might recommend bash, in part because of the Advanced Bash-Scripting Guide at the LDP. It should have all the information you need. I'ld give you a link, but I use a mirror near me and I don't know where you are located.
 
Old 04-06-2003, 09:45 AM   #4
WarriorWarren
LQ Newbie
 
Registered: Apr 2003
Posts: 17

Original Poster
Rep: Reputation: 0
terribly sorry chris, I didnt realize that the forum doesnt enjoy helping others understand Linux.

I also am not asking someone to do my homework, im asking for a little help and guidance. All the tools required are not in the resources that are supplied, it is intened that some information is
researched and discussed with others.

Also being from UK myself, and being a part time adult student I must admit I am struggling with this assignment and this is a last resort to actually ask online.

Dont worry, no more questions about homework thoug. Thanks for your time.
 
Old 04-06-2003, 09:48 AM   #5
WarriorWarren
LQ Newbie
 
Registered: Apr 2003
Posts: 17

Original Poster
Rep: Reputation: 0
Hi thanks, I have started writing the script in bash
im using commands find, cp and if statements. I am in the UK

Last edited by WarriorWarren; 04-06-2003 at 09:51 AM.
 
Old 04-06-2003, 09:54 AM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Give the guy a bit of a break - take a look at:
http://www.comp.nus.edu.sg/~gokulpod...ash-script.pdf
Search the document for
"a list of test’s options"
"mkdir"
"cp"

This should be all you need to write a bash script.
 
Old 04-06-2003, 09:56 AM   #7
WarriorWarren
LQ Newbie
 
Registered: Apr 2003
Posts: 17

Original Poster
Rep: Reputation: 0
you are a gentleman and a scholar
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with creating a shell script windisch Programming 66 10-07-2005 06:26 AM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM
shell script: delete all directories named directory.# except directory.N brian0918 Programming 3 07-13-2005 06:54 PM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 10:23 PM
Back-up Shell Script apoc013 Linux - Newbie 7 01-23-2004 01:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:31 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
Open Source Consulting | Domain Registration