LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How Can I Backup My Server? (https://www.linuxquestions.org/questions/linux-general-1/how-can-i-backup-my-server-33917/)

John_Saunders 10-27-2002 12:59 PM

How Can I Backup My Server?
 
I have a dedicated server running Red Hat 7.2. I would like to back up all of my folders/files and download them to my local server for a backup copy. I've tried running the two commands below from the root directory while logged in as root in SSH and neither one of them work.

zip 10_27_02.zip -r -9 tar bin boot dev etc home initrd lib mnt opt proc root sbin tmp usr var

---> this came up with:

bash: zip: command not found

tar -cf 10_27_02.tar bin boot dev etc home initrd lib mnt opt proc root sbin tmp usr var

---> this came up with:

tar: dev/log: socket ignored
tar: proc/kcore: File shrank by 32242176 bytes; padding with zeros
tar: proc/2/exe: Cannot readlink: No such file or directory
tar: proc/3/exe: Cannot readlink: No such file or directory
tar: proc/4/exe: Cannot readlink: No such file or directory
tar: proc/5/exe: Cannot readlink: No such file or directory
tar: proc/6/exe: Cannot readlink: No such file or directory
tar: proc/7/exe: Cannot readlink: No such file or directory
tar: proc/8/exe: Cannot readlink: No such file or directory
tar: proc/9/exe: Cannot readlink: No such file or directory
tar: proc/13/exe: Cannot readlink: No such file or directory
tar: proc/74/exe: Cannot readlink: No such file or directory
tar: proc/166/exe: Cannot readlink: No such file or directory
tar: proc/3052/fd/4: Cannot stat: No such file or directory
tar: proc/3055/fd: Cannot savedir: No such file or directory
tar: proc/3055/mem: File removed before we read it
tar: proc/3055/cwd: Cannot readlink: No such file or directory
tar: proc/3055/root: Cannot readlink: No such file or directory
tar: proc/3055/exe: Cannot readlink: No such file or directory
tar: tmp/ssh-XXBT1TFk/agent.15840: socket ignored
tar: tmp/mysql.sock: socket ignored
tar: tmp/ssh-XXa63hg9/agent.1214: socket ignored
tar: tmp/ssh-XXdvhtjG/agent.1138: socket ignored
tar: tmp/ssh-XXOQnLWd/agent.3403: socket ignored
tar: tmp/ssh-XXk1VOLP/agent.1620: socket ignored
tar: tmp/ssh-XXqWs8yO/agent.1586: socket ignored
tar: tmp/ssh-XXgmoMEF/agent.4519: socket ignored
tar: tmp/ssh-XXQoXbea/agent.2206: socket ignored
tar: Error exit delayed from previous errors


Can somebody tell me what I need to do to get the ZIP command to work, or what I need to enter to tar and gzip every folder/file on my server to one file I can download?

markus1982 10-27-2002 01:18 PM

Honestly I'd not even use such one for filesystem backup. When I do a backup and what to have a posibility of ease restore I usually use the dump-tool. Example:

You want to backup all data on hda1 and use a compression level 9 for that (= maximum compression) then you'd do

dump -0 -z9 -f example.dump /dev/hda1

The location of the example.dump should not be on the same partition (example.dump should not be on hda1). It might be helpful at a later state to know about the partitions so maybe do a

df -alh > partitions


At the later state when you want to restore the dump, join the directory where you want to put the filesystem you dumped on (e. g. /var) and type

restore rf example.dump


If you have a RH rescue CD for instance you can boot up with that CD and have the dumps on a FTP-server (username can be anything but password has to be empty) and restore the whole server using FTP ...


I've restored a huge server (COMPLETELY) in 1 hour ... now that safes you some time in case of let's say if your box got hacked and binaries replaced with trojaned versions or something alike ;)


Hope this helps ;)


All times are GMT -5. The time now is 09:16 PM.