LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-11-2005, 10:15 PM   #1
BBQ_Matt
LQ Newbie
 
Registered: Sep 2003
Location: Sydney, Australia
Distribution: ubuntu, suse, redhat
Posts: 18

Rep: Reputation: 0
Unhappy Shell Script for backup


Hi,

I need a script that will read in a file containing directories that I want backed up, tar each of those directories seperately and store in a single directory.

I can't write a script very well and am desperate for some hints.

Matt
 
Old 05-11-2005, 10:25 PM   #2
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
Though what you want is fairly simple, for the moment I've forgotten the way to write a PERL for loop (to go through the backup list).

Have a look at this page. Some of these scripts might be overkill for what you want but they look like the might be useful
http://www.linuxlinks.com/Software/Backup/Scripts/
 
Old 05-11-2005, 10:41 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Re: Shell Script for backup

Quote:
Originally posted by BBQ_Matt
Hi,

I need a script that will read in a file containing directories that I want backed up, tar each of those directories seperately and store in a single directory.

I can't write a script very well and am desperate for some hints.

Matt
Can you elaborate on the bit I highlighted in bold?
I don't quite understand what you're up to...


Cheers,
Tink
 
Old 05-11-2005, 11:10 PM   #4
BBQ_Matt
LQ Newbie
 
Registered: Sep 2003
Location: Sydney, Australia
Distribution: ubuntu, suse, redhat
Posts: 18

Original Poster
Rep: Reputation: 0
I want to store each of the outputted *.tar files into a single directory. Make sense?
 
Old 05-12-2005, 01:45 AM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Nope :}

All of them together in one directory, or each in an
individual directory?


Cheers,
Tink
 
Old 05-12-2005, 11:47 AM   #6
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
This is what he wants:

Take /etc /var /usr

and make:

/backup/etc.tar
/backup/var.tar
/backup/usr.tar


...for example.
 
Old 05-12-2005, 05:01 PM   #7
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
What you are looking for already exists. DAR . I searched for 4 years for something to give me backups my way. I found it in DAR.
Once you get the config worked out (takes a bit of study and practice), you will have a backup in which each file is compressed individually. Dar allows you to specify files to exclude from compression (because they're already compressed); directories to backup the tree, but leave out the files; directories in include/exclude; the list goes on.
Restoration is easy, and works like a charm.
My 6 gig setup ends up as 2.7 gig in the backup file.

Dar is command-line. The GUI version is Kdar.
 
Old 06-30-2005, 05:19 PM   #8
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
Quote:
Originally posted by bigrigdriver
What you are looking for already exists. DAR . I searched for 4 years for something to give me backups my way. I found it in DAR.
Sweet! Thanks for the info!

Peace...
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script to remove backup ~ files hallamigo Linux - General 3 09-13-2010 03:47 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
Incremental Backup shell script. datadriven Linux - General 3 06-02-2004 09:19 AM
writting a backup shell script yenonn Slackware 2 03-18-2004 07:49 PM
bash shell backup script turnip Programming 0 04-03-2003 06:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration