Help: Bash backup script (includes copy, test-

Basically it's for a work assignment.
Have to make a menu with the following choices

***************menu*********************

1) Show Current Directory
2) Dispaly Current Time and Date
3) Copy
4) Change Password
5) write directory to file
6) Edit File Directory
7) Make backup from /home/user
8) Show proces of this script
9) Show name and version of OS
10) Close and Shutdown System
q) Stop

I managed to do all of them using a check-function with a case inside it.

1)
echo `pwd`
back
;;

2)
echo `date`
back
;;

3)
kopie
/////////function
back
/////////funcion which takes you back to choice menu
;;

4) wijzigpaswoord
//////function
back
;;

5) dumb -f dirdump.dmp `pwd`
back
;;

6) vi `pwd`/dirdump.dmp
back
;;

7)

8) ps -ef grep menu

9)echo `uname -ov`
terug
;;

10) shutdown -P now
terug
;;

q)
clear
break

----------

Only problem is the 7th option. I have absolutely no clue whatsoever how to do this thing or how to make it happen.
Figured as last hope I'll try here to see if there are any Linux-experts at work.

What 7 should do:

choice 7, make a back up of the current directory, in this case home/user .all files in this directory should be copied first to filename.back after which, they have to be copied to directory /backup, make a a test if this directory exists, if not create it. If the files are transfered, remove the bac-files from your directory.

If anybody can help me, thx in advance. :slight_smile:

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.