LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-15-2002, 08:00 AM   #1
jester_69
Member
 
Registered: May 2002
Location: Sydney Australia
Distribution: Redhat 6.1 & 7.2
Posts: 91

Rep: Reputation: 15
How do you do this ???


Hello,,

I want to back up all my .conf files on a redhat 6.1 machine before making an upgrade attempt. Can i run some sort of gzip command that will find all of them from my / folder down ???

Regards

Andrew
 
Old 06-15-2002, 08:15 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
If you are looking for all of your .conf files you could do something like this (I am sure there is a better way, just an idea):

Code:
mkdir /home/confstuff
cp /*.conf /home/confstuff
cd /home/confstuff
gzip (or whatever you'd like) *.conf.gz
I am not even sure if that will work, but it's probably what I would try.

Good Luck
 
Old 06-15-2002, 10:50 AM   #3
jester_69
Member
 
Registered: May 2002
Location: Sydney Australia
Distribution: Redhat 6.1 & 7.2
Posts: 91

Original Poster
Rep: Reputation: 15
No doesn't work from this level. Thats what i tried but you get the following


[root@echelon confstuff]# cd /
[root@echelon /]# cp *.conf /etc/backup_files/confstuff/
cp: cannot stat `*.conf': No such file or directory
[root@echelon /]# cp /*.conf /etc/backup_files/confstuff/
cp: cannot stat `/*.conf': No such file or directory
[root@echelon /]# cp / *.conf /etc/backup_files/confstuff/
cp: omitting directory `/'
cp: cannot stat `*.conf': No such file or directory

Hah funny though that you chose the exact wording for the backup

Thanx 4 the suggestion though

Cheers

Jester
 
Old 06-15-2002, 11:27 AM   #4
Brion
Member
 
Registered: May 2002
Location: Belgium
Distribution: LinuxFromScratch
Posts: 85

Rep: Reputation: 15
try this:

find / -name "*.conf" -exec cp {} /dir/where/you/keep/the/config/files/temporarily

then zip that directory
 
Old 06-15-2002, 11:39 AM   #5
coder2000
LQ Newbie
 
Registered: Jun 2002
Distribution: Red Hat
Posts: 16

Rep: Reputation: 0
You could also try

cp ls *|grep .conf /where/you/want/the/files

although I don't know how well that will work
 
Old 06-15-2002, 10:12 PM   #6
linuxcool
LQ Addict
 
Registered: Jun 2001
Posts: 1,183

Rep: Reputation: 47
You might need the -R option to get it to work.

cd /
cp -R *.conf /etc/backup_files/confstuff/
 
Old 06-15-2002, 10:16 PM   #7
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
well that's cool, but you need to know where they came from so do this

locate *.conf > /save/folder/configfilemap
 
Old 06-15-2002, 10:23 PM   #8
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
this does not seem like the right way to do backups though

should you use tar and have it save the directory structure for you


you probably want to keep the owner and permission info intact


not to mention the duplicate filenames

Last edited by DavidPhillips; 06-15-2002 at 10:33 PM.
 
Old 06-16-2002, 01:20 AM   #9
FrankMabrey
LQ Newbie
 
Registered: Nov 2001
Location: Left Coast
Posts: 6

Rep: Reputation: 0
Try this:

find / -name "*.conf" -exec tar -cvf yourTarFileName {} \;

then zip yourTarFileName

Frank
 
  


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 On
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:55 AM.

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