Alan - Vox
04-05-2002, 12:32 PM
Ive just got an internal network setup for my servers, my intention is to backup one server to another.
Does anyone know what is a secure way to transfer very large files from one server to another? Ftp says the file is too big, i cant use wget because that would require putting the backups on a different partition.
SYNATIX
04-05-2002, 12:34 PM
Hmmm lol this might sound stupid but take the harddrive and plug it into the other system along with the harddrive it already had and to a manually transfer or just keep both hard drives.
:stickout
allera
04-05-2002, 12:36 PM
Take a look at rsync. I forget the URL, search Google.com for it.
ScottD
04-05-2002, 01:00 PM
You may want to look at flexbackup.
I use it with FreeBSD and it works great for backing up all of my servers. It uses ssh to get to remote servers and backs the data up with afio, buffer, and you can compress with bzip2 or gzip.
Very easy to set up and get working. For cron I did this:#
# Backup jobs.
#
# Level 0 backup occurs every saturday.
# Level 1-6 backups occur each progressive day.
#
0 2 * * sat /usr/local/bin/cron_env.sh /usr/local/bin/backup_sat
0 2 * * sun /usr/local/bin/cron_env.sh /usr/local/bin/backup_sun
0 2 * * mon /usr/local/bin/cron_env.sh /usr/local/bin/backup_mon
0 2 * * tue /usr/local/bin/cron_env.sh /usr/local/bin/backup_tue
0 2 * * wed /usr/local/bin/cron_env.sh /usr/local/bin/backup_wed
0 2 * * thu /usr/local/bin/cron_env.sh /usr/local/bin/backup_thu
0 2 * * fri /usr/local/bin/cron_env.sh /usr/local/bin/backup_friAllowing me the flexibilty to change how each day is run. For example, backup_sat will always archive the previous week to a different directory before running.
You can take a look at flexbackup here: http://sourceforge.net/projects/flexbackup/ though it is out of date. The official home page is http://members.home.com/flexbackup/ but we all know what happened to @home. I am not sure if work is still being done on it or not, but it works as it is right now.
Alan - Vox
04-05-2002, 01:11 PM
Anyone know how to use scp?
ScottD
04-05-2002, 01:20 PM
scp uses the same command line as rcp but it uses ssh to tunnel the data.
To avoid having to enter a password each time you use it look into setting up s/key authentication from your backup server to your other servers.
Alan - Vox
04-05-2002, 01:30 PM
Sounds tricky, can you explain to me how to do it?
ScottD
04-05-2002, 01:34 PM
You can read some pretty good documentation here: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/skey.html that should help you. It's from the FreeBSD documentation, but it generally holds true for linux with openssh as well.
ScottD
04-05-2002, 01:55 PM
Alan,
Ignore my previous message. I just read that document and it makes it more complicated than you need.
From your backup server do this:
[user@backup]# ssh_keygen
[user@backup]# cat ~/.ssh/identity.pub | ssh user@remote.host.com 'cat >> ~/.ssh/authorized_keys'
That is easier to follow. :)
What this does is allows you to ssh to the remote host without a password, therefore scp will work for that user. Since you need pretty aggressive permissions to do full backups, you probably want to execute the backup as root (any sys-admins feel free to beat me up on this!).
I hope that helps at least a little.
Alan - Vox
04-07-2002, 01:44 PM
That doesnt work for me, ssh_keygen gives command not found error
allera
04-07-2002, 02:00 PM
For RSA:
ssh-keygen
for DSA:
ssh-keygen -d
For more information on authorized_keys (for RSA) and authorized_keys2 (for DSA), read:
man ssh
man sshd
Originally posted by SplashHost.com
That doesnt work for me, ssh_keygen gives command not found error
It's ssh-keygen (with hyphen) :)
NyteOwl
04-07-2002, 10:13 PM
For a decent Perl script for moving files you might try SideLoad at http://www.ericscgi.com
Here is a brief SCP tutorial a friend of mine wrote:
scp - An Easy Introduction for a Newbie.
scp is a command that comes with the SSH suite of utilities. scp stands for "Secure CoPy". This command is used to copy files from one computer to another computer over a network. You don't need NFS ot FTP, or even samba to use this command. Two things that you do need are SSHd (SSH Daemon), running on the computer to which you are going to copy the file, most distributions of Linux and flavors of free UNIX like Operating Systems such as NetBSD and OpenBSD all come with this daemon configured to start at bootup by default, FreeBSD however gives you a choice of enabling or disabling it during system install. And then you will need to have an account on the remote computer as well.
Usage Scenarios:
You have 2 computers, one's name is comp1 and the other's name is comp2. And you need to copy the file howto.tar.gz from comp1 to comp2 you will use the following command syntax:
opensorceror@comp1$ scp howto.tar.gz opensorceror@comp2:/home/opensorceror
Note that you could also use the machine's IP address instead of hostnames as well, for example:
opensorceror@comp1$ scp howto.tar.gz opensorceror@192.168.0.2:/home/opensorceror
If the above command is successful, i.e. your password for the remote machine (comp2/192.168.0.2) is correct and the source file/directory and destination directory exist, you should see a password prompt exactly like SSH usually greets you with followed by the following output:
opensorceror@comp2's password:
howto.tar.gz 5% |**** | 5253 ETA 05:10
As you can clearly see, the output above is the progress of the copy process between the two computers. You can also copy a file from the remote computer to the computer that you are physically working on, the syntax for that would be something similar to the following:
opensorceror@comp1$ scp opensorceror@comp2:/home/opensorceror/howto.tar.gz .
The command above copies the file howto.tar.gz from the remote computer (comp2) to your machine (comp1) and into the current working directory (.).
Well, this is all most people need to know about scp in order to start using it effectively. If you have some special requirements you can always read its manual page (using the man command).
by OpenSorceror (opensorceror@yahoo.com)
Hope it helps