|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Backup script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|