LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-22-2015, 12:18 AM   #1
unclesamcrazy
Member
 
Registered: May 2013
Posts: 189

Rep: Reputation: 1
Take backup of all sensitive files to start work as a novice sys-admin


I am trying to editing files of /etc/ and similar directories but I do not know much about inner structure as I could harm my server. I want to take back up of all imortant file but I do not want to use just "cp -r", I want to use well built script.

I have found one here. Can I use this to take backup of my /etc/ directory?
http://borahshell.blogspot.in/2014/0...recursive.html

I can not try and observer result because server will not give me second chance that's why I thought, I should ask you all expert first.

Please comment on the script.

Thank You

--Regards
Sam
 
Old 06-22-2015, 02:50 AM   #2
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,128

Rep: Reputation: 232Reputation: 232Reputation: 232
That script just uses cp (recursively).
How will you backup symbolic links?

Most files are owned by root and have various group owners.
You will need to preserve these.

rsync can handle the permissions - not sure about the links.
 
Old 06-22-2015, 08:27 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,785

Rep: Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159
Quote:
Originally Posted by unclesamcrazy View Post
I am trying to editing files of /etc/ and similar directories but I do not know much about inner structure as I could harm my server. I want to take back up of all imortant file but I do not want to use just "cp -r", I want to use well built script.
Since you've been asking about shell-scripting for two years now, shouldn't you be able to write your own easily at this point? And if this IS an important server, won't you already have backups of these files on another media/location already?
Quote:
I have found one here. Can I use this to take backup of my /etc/ directory?
Since that is exactly what that script says it does, it seems obvious that you can. Did you try to just RUN that script, to see what result you got? See what kind of backup it gave you??? Since that script is very simple, and it's using the built-in Linux cp command, you can easily modify it to preserve whatever attributes you want to keep, including following symlinks.
Quote:
I can not try and observer result because server will not give me second chance that's why I thought, I should ask you all expert first.
If you're the systems administrator, you should know these things already, shouldn't you? How did you get the job otherwise?
 
  


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
sys admin vs network admin sulekha Linux - General 5 01-11-2009 05:03 AM
Wannabe Sys Admin Sepia LinuxQuestions.org Member Intro 3 11-08-2007 08:21 AM
Sys Admin Scenarios logicalfuzz Linux - Certification 0 11-16-2005 10:49 PM
Looking for a Linux Sys Admin ftbaccounts Linux - Certification 1 02-08-2005 12:11 PM
Linux Sys Admin smurphy Linux - General 2 07-31-2001 07:05 AM


All times are GMT -5. The time now is 09:27 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration