LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
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: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
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 Squeeze
Posts: 5,767

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 01:33 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration