LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 10-21-2011, 02:05 AM   #1
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Rep: Reputation: 1
server backup


Hi

i have centos 5.3 installed , i want data to backup from one location to another location,

how can it poassible in centos


AMAR
 
Old 10-21-2011, 05:33 AM   #2
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
just compress the folder you want to take backup of

Code:
#tar -zcvf (tar-archive-name.tar.gz)  (source-folder-name)
and use scp to copy from server location to remote location

Code:
#scp (foldername) 192.168.0.100:/backup/
                             ^
                             |
                             |
         IP of remote machine with location of bacup folder
 
Old 10-21-2011, 06:08 AM   #3
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
If you want to set it up as a cron job, to do it automagically, without authentication.
Set up passwordless authentication on the remote server the backup is destined for, and use something like:

Code:
tar -cJf /folder | ssh -i keyfile user@server ">" file.tar.xz
 
Old 10-21-2011, 06:12 AM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,375

Rep: Reputation: 240Reputation: 240Reputation: 240
Wink

Quote:
Originally Posted by amartlk View Post
Hi

i have centos 5.3 installed , i want data to backup from one location to another location,

how can it poassible in centos


AMAR
i had also same problem, then while trawling the web found this link:
http://www.lazysystemadmin.com/2010/...ile-it-is.html
 
Old 10-21-2011, 06:15 AM   #5
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Original Poster
Rep: Reputation: 1
Thanks for reply

i tried this but it was copied in my local pc but not in remote pc, it shows copying but when i see in remote pc it will not shown cpied file,
if i want to copy from centos server to remote windows pc then it is possible or not

and the solution you given here i have to manually fired command as i want this backup done automatically at midnight daily on remote pc pls suggest
 
Old 10-21-2011, 06:21 AM   #6
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
Quote:
Originally Posted by amartlk View Post
if i want to copy from centos server to remote windows pc then it is possible or not
Nice of you to mention that in your OP... And people wonder why they dont get the answer they are looking for.

Backing up TO a windows machine is kind of like putting all of your eggs in one concrete mixer....
 
Old 10-21-2011, 06:26 AM   #7
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,375

Rep: Reputation: 240Reputation: 240Reputation: 240
you can try exploring the rsync command if you want automation, but please make sure you understand everything before you do anything.

You might end up losing your data.

here's the link for rysnc backup example:
http://www.bobulous.org.uk/misc/rsync-backup.html

you can use crontab to run the script at night:
http://rootprompt.org/article.php3?article=8976
 
Old 10-21-2011, 06:31 AM   #8
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by amartlk View Post
Thanks for reply

i tried this but it was copied in my local pc but not in remote pc, it shows copying but when i see in remote pc it will not shown cpied file,
if i want to copy from centos server to remote windows pc then it is possible or not

and the solution you given here i have to manually fired command as i want this backup done automatically at midnight daily on remote pc pls suggest
what was the command that you were trying?

just try samba server.it is the best one for sharing files and folder between linux and windows
 
Old 10-21-2011, 07:22 AM   #9
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Original Poster
Rep: Reputation: 1
Hi deep27ak

#tar -zcvf (tar-archive-name.tar.gz) (source-folder-name)

and use scp to copy from server location to remote location

Code:

#scp (foldername) 192.168.0.100:/backup/
^
|
|
IP of remote machine with location of bacup folder


this work for me, i copied data from one centos server to another centos server, but i want this should done automated at everymidnight, pls suggest
 
Old 10-21-2011, 08:22 AM   #10
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
I am not so good with crontab but you can try this one
Code:
#crontab -e

0  0  *  *  *   tar -zcvf (tar-archive-name.tar.gz) (source-folder-name) && scp (foldername) 192.168.0.100:/backup/
but this will ask for password everytime it uses scp so you need to generate a RSA key for scp

Code:
#ssh-keygen -t rsa -----(on your server)
(follow the steps and generate a pass phrase)

Now copy the id_rsa.pub to your remote machine

Code:
#scp ~/.ssh/id_rsa.pub 192.168.0.100:~/.ssh/authorized_keys
By default authorized_keys file is not present so you will have to create that manually on your remote machine
(on your remote machine)
Code:
#touch ~/.ssh/authorized_keys
Now try accessing your machine with ssh
It will ask for the RSA passphrase instead of password

Now you can save this password
(on your server machine)

Code:
#ssh-agent /bin/bash
#ssh-add
(enter the passphrase)
now try ssh to your remote machine, it won't ask for password or any passphrase
 
Old 10-21-2011, 08:29 AM   #11
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
see something like you need I wrote a guide
 
  


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
What is the best backup method to make a backup of a running Ubuntu server ? pmorin Linux - Software 9 09-28-2011 08:12 AM
tar backup on server with 24Gb RAM - 96% cached and bdflush,kwapd feeze my server alexferro Linux - Server 4 05-23-2010 04:20 AM
Server configuration for small office server, which smtp, pop imap server and backup whitelinux Linux - Server 4 04-06-2010 12:26 PM
Using RSync to backup a secondary off-site backup server pezdspencer Linux - Software 4 06-29-2007 04:40 PM
LXer: Backup MySQL databases, web server files to a FTP server automatically LXer Syndicated Linux News 0 08-11-2006 10:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:24 PM.

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