SPjames
07-07-2004, 06:10 PM
i just installed NCFTP in my new server, i need to copy the entire /backup directory from my old server
what would be the commands to:
1. connect and login root into the old server
2. bookmark (creating a short cut)
3. copy the entire directory /backup
thanks in advance
linux-tech
07-07-2004, 06:44 PM
This isn't really "programming" howto, but heregoes.
Firstly, root login via ftp is (and should always be) disabled by default on linux servers, so this isn't something that should be done by any means. There are alternate ways of doing this, such as rsync. To rsync from server1 /backup to server2 /backup, the command is pretty straightforward. This shell script should get it done for you.
$RSYNCCMD="ssh"
$RSYNCARGS="-az --stats"
$MYBDIR="/backup"
$MYBDEST="/backup"
$MYBACKUP="server1"
rsync $RSYNCARGS -e $RSYNCCMD $MYBACKUP:/$MYBDEST/ $MYBDIR
Depending upon the size of the directory, this will take a bit of time. Personally, I do this over ssh, you can do it without it, but I use ssh myself to do this.
G'luck