Help: Bash backup script (includes copy, test-


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help: Bash backup script (includes copy, test-
# 1  
Old 11-26-2010
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. Smilie
# 2  
Old 11-26-2010
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script to take cPanel backup in batches

I'm trying to resolve the below scenario by writing bash script. On my managed linux server I have about 30 accounts and there is not enough space to generate full 30 accounts backup in one go and transfer it via SFTP to my Backup Synology Server. What I'm thinking of doing is breaking the... (3 Replies)
Discussion started by: humble_learner
3 Replies

2. Homework & Coursework Questions

Create a simple bash backup script of a file

This is the problem: Write a script that will make a backup of a file giving it a ‘.bak’ extension & verify that it works. I have tried a number of different scripts that haven't worked and I haven't seen anything really concise and to the point via google. For brevity's sake this is one of the... (4 Replies)
Discussion started by: demet8
4 Replies

3. Shell Programming and Scripting

Backup script / Test if script is already running

Hello everyone, I have 2 questions : 1) I have a backup shell script, let's call it backup.sh, that is called every hour as a cron job. As a matter of fact a backup could last more than one hour. It mounts a NAS and then do some rsync on important directories, so really I don't want to... (2 Replies)
Discussion started by: freddie50
2 Replies

4. Shell Programming and Scripting

Bash Backup script

Hello, I'm supposed to create a simple script to backup onto a network using tar and scp -r command as well as the ~.bashrc to designate commands as a part of bash. I am having trouble making mine work. I would like to ask for input as to what I may be doing wrong. Here it is: !/bin/bash # #... (1 Reply)
Discussion started by: polineni
1 Replies

5. Shell Programming and Scripting

Bash script to test IP range on server

Hello, We have to configure servers with a range of IPs which is in itself a subject for another script assistance request -but- we have run into quite a few IP ranges with routing problems lately. I've been trying to figure out the best way to test a range of IPs, I mean, manually it's not... (4 Replies)
Discussion started by: boxgoboom
4 Replies

6. Shell Programming and Scripting

error in sh script while copy files to a backup directory

I am trying to copy files from one directory to another using shell script. Can anyone please troubleshoot the code. thanks in advance... #!C:\Shell\sh.exe files_dir="C:\Documents and Settings\scripts\files" backup_dir="C:\Documents and Settings\scripts\ztest" echo cding to... (2 Replies)
Discussion started by: sureshcisco
2 Replies

7. UNIX for Dummies Questions & Answers

How do i tell my bash shell script to test the output of a command against something

How do i tell my bash shell script to test the output of the command i'm using?? I want this script to look for lines not equal to 1 then let me know.. $ cat blah ; echo ---- ; cat blah.sh 1 fe 1 fi 1 fo 0 fum 1 blahda 1 blah 0 blahh 1 bla 1 bl 1 blahhh ---- #!/bin/bash while... (1 Reply)
Discussion started by: phpfreak
1 Replies

8. Shell Programming and Scripting

bash script to test network connection - please help

I want to test if my host can connect to any of the following 10 hosts (192.168.1.0 to 192.168.1.9) I didnt know which command i should use, so i chose ping. (i wonder if i should use tracepath or sth else) my code is the following: #!/bin/bash clear firstPart="192.168.1" maxNum="9" ... (2 Replies)
Discussion started by: shadow_boi
2 Replies

9. Shell Programming and Scripting

[bash] Simple backup (cp) script but incremental

Hi all, I would need a rather simple bash backup script that loops throught the (local) users and for each users backs up (cp!) its /home/username folder. About the functionalities: The script has to run every 2 hours (that's cron, so don't mind about that) and the files should be copied to... (12 Replies)
Discussion started by: laurens
12 Replies

10. Shell Programming and Scripting

Bash script to backup each domain?

Hi there, I need sh script to create a backup per domain and then ftp each file to different host. let's say I have bunch of domains in /var/www/vhosts/ so when sh will be executed it will create something like domain.com.tar.gz domain2.tar.gz Can somebody help? Thank you, Dmitry (0 Replies)
Discussion started by: dmitryseliv
0 Replies
Login or Register to Ask a Question