LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Take backup of all sensitive files to start work as a novice sys-admin (https://www.linuxquestions.org/questions/linux-newbie-8/take-backup-of-all-sensitive-files-to-start-work-as-a-novice-sys-admin-4175546048/)

unclesamcrazy 06-22-2015 12:18 AM

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

JeremyBoden 06-22-2015 02:50 AM

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.

TB0ne 06-22-2015 08:27 AM

Quote:

Originally Posted by unclesamcrazy (Post 5380915)
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?


All times are GMT -5. The time now is 10:58 PM.