how to write shell script to take back up


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to write shell script to take back up
# 1  
Old 05-28-2008
how to write shell script to take back up

Helo,
I want to write shell script which takes back of all binaries (exe files).
and when i uninstall the upgraded system which automatically restore the old binary which we have take as back up.
can u tell me how to write such shell scripts.

Regards,
Amit
# 2  
Old 05-29-2008
Quote:
Originally Posted by amitpansuria
I want to write shell script which takes back of all binaries (exe files).
and when i uninstall the upgraded system which automatically restore the old binary which we have take as back up.
can u tell me how to write such shell scripts.
Your specification feels a little vague to me but here's somewhere to start:
To back up all '*.exe' files on the system:
Code:
tar -cf - `find / -type f -name "*.exe"` | gzip -c > /whereever/you/want/your/backup.tar.gz

To restore:
Code:
cd /
gunzip -c /whereever/you/want/your/backup.tar.gz | tar -xf -

# 3  
Old 05-30-2008
Smiling Dragon,

Would you mind posting the code to backup and restore the whole disk farm too? (I haven't used tar that much.)

Thanks,

shew01
# 4  
Old 05-31-2008
To backup all of your disk to a tape for example
go to disk root, then
Code:
tar -cvf /dev/rmt0 .

# 5  
Old 05-31-2008
Quote:
Originally Posted by xxmenxx
To backup all of your disk to a tape for example
go to disk root, then
Code:
tar -cvf /dev/rmt0 .

Okay. What is the syntax to restore the entire drive from this backup?
# 6  
Old 06-01-2008
tar -xvf /dev/rmt0 .
You can replace the " . " with the destination where you want to restore the files.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Spooling File to My Desktop From Back-end using shell script

Hello all, I am trying to spool a SQL query output file from back-end to desktop in a certain path but it didn't work,the query writes the output in a file in the same directory at the back-end. note : i use the same query in sql developper and file was created in the desired path fine code... (1 Reply)
Discussion started by: bmaksoud
1 Replies

2. Shell Programming and Scripting

Passing control back to the shell script

Hi All, I have a shell script(test_abc.sh) with the following shell commands, which are invoking the same shell script with different parameters. test_abc.sh . ./test.sh abc >> test.log . ./test.sh xyz >> test.log . ./test.sh pys >> test.log . ./test.sh abc >> test.log . . ... (4 Replies)
Discussion started by: dev.devil.1983
4 Replies

3. Shell Programming and Scripting

How to write config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

4. UNIX for Dummies Questions & Answers

How to write Config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

5. Programming

Signal out from fork()'d shell script back to the C++ application

Hi, I am writing a C++ application; in which at one point I fork() a new process, which executes a shell script (via execv() call). Now the shell script can take a while to finish (tarring, burning a cd, etc.) and I would like to update the parent application about the progress (while the script... (3 Replies)
Discussion started by: mirni
3 Replies

6. Shell Programming and Scripting

Shell Script to filter users and create them again from a back-up server

This is a script to filter the users out of etc/passwd and etc/group. So if you want to migrate of restore a server you can use this script from a backup to restore and make the same users on you had.. Please feedback and comments. #!/bin/bash prompt_list () { # haal uit de argumenten de... (5 Replies)
Discussion started by: dannyvdberg
5 Replies

7. Shell Programming and Scripting

how to write a shell program for back up

Hello.. I want to take back up from server to local machine and i dont know how to do it using cron and sftp . I can do it by manually typing password in the terminal and taking the back up. How to create a 'backup.sh' file for doing all the back up process and shut down automatically after... (1 Reply)
Discussion started by: deepoos
1 Replies

8. Shell Programming and Scripting

Need to Write Shell Script based off of this shell command

I'm trying to read a bunch of log files and output the lines that contain particular strings. To accomplish this, I've been running the following from the command line: find . -name "*" | xargs grep " " | grep " " > output.txt Two grep statements are needed in case I'm looking for a... (3 Replies)
Discussion started by: Rally_Point
3 Replies

9. Programming

Passing Parameters and getting values back from a c program to Shell script

I am having a shell script which has to be called from a C program. I have to pass two parameters to this script. HOw can I do that? eg: int main() { char st1; char str2; // call a shell script call_sh(str1,str2) where call_sh is the name of the shell script. then i need to get the return... (5 Replies)
Discussion started by: Rajeshsu
5 Replies

10. UNIX for Dummies Questions & Answers

How to pass a oracle variable back to the shell script

Hi, I am calling an oracle function that returns a number (either 0 or 2), how do I pass that pass to the wrapping shell script as I would like to do other things based on the value returned by the oracle function. Your help will be appreciated. -------------------------- sqlplus / <<... (3 Replies)
Discussion started by: Jtrinh
3 Replies
Login or Register to Ask a Question