UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old December 7th, 2004, 03:55 PM
jackjill jackjill is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 9 jackjill User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Backup script

Description: I'm trying to write a shell script for taking backups. This Script will use cp command to take backups. Script can read the list of directories and destination directory from a file or ask user for this information interactively.

here is the final trial run of script.

Example 1: Only two options -i (for interactive run) and “-f file” (to read backup information from a file) are allowed. When an invalid option is entered script displays a message as shown below.

# a2backup -r
syntax: a2backup [ -i | -f file ]

Example 2: Example of interactive run.

# a2backup -i
Welcome to the Interactive Backup Utility
Enter the source directory [/home/maskara/sya710]:
Enter the destination directory: /home/backup
What type of backup do you want ( [i]ncremental/[f]ull backup) [i]:
Follow symbolic link (Y/N) [n]:

Directory backed up successfully.

Example 3: Backup information is read from file dir_list

# a2backup -f dir_list
Welcome to Interactive Backup Utility
Starting Backup..
Directory(ies) backed up successfully.

Example 4: Backup information is read from the file “.backup” in current user's home directory.

# a2backup
Welcome to Interactive Backup Utility
File “.backup” found in user's home directory.
Starting Backup..
Directory(ies) backed up successfully.

Example 5: File “.backup” does not exist in user's home directory.

# a2backup
Welcome to Interactive Backup Utility
File “.backup” NOT FOUND in user's home directory.
Exiting..

Syntax of backup information file (.backup or filename specified with –f option):

# the file may have following information

destination = destination_directory
source_directories = path1,path2,path3 ..
fullbackup = 1 # 1 means yes 0 means no
followsymlink = 0

Error checking and action:

Destination directory is created when does not exist.

If any of the source directory does not exist program terminates with an error message.

that's it.
Please tell me the easiest way to accomplish it.

Reply With Quote
  #2  
Old December 7th, 2004, 04:14 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,442 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 h 51 m 47 sec
Reputation Power: 797
Easiest way is to ask your teacher to help out perhaps? Last I checked, this wasn't a homework forum and people are less likely to help you if you don't show any effort yourself.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Backup script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway