Rsync

From Just another day in the life of a linux sysadmin
Jump to navigation Jump to search

Pushing a file from a backup server (or a server in general)

(for backup servers) locate the file and mount the image to a dir. For example:

mkdir /mnt/QU6YF3/
mount 20150721T220216.img.p3 /mnt/QU6YF3/

then locate the file you want and push it to the server

The Rsync command to push this can be used for any server file push:

rsync -$options /source/path $user@$remote_server:/destination/path

usually

rsync -avHP /Path/to/file root@IP:/dest/path

look for alt ssh port

"Push"

rsync -avHPe ssh /$source/$path root@$ip:/$destination/$path

ALT PORT PUSH

rsync -avHP /local/path/ -e "ssh -p $port" user@remoteip:/path/to/files/
rsync -avHP -e "ssh -p 2222" LOCATION/FILENAME.EXT  root@IPADDRESS:/PATH/TO/SERVER/FILENAME.EXT

may work but usually changing the alt ssh port is faster

you may also need to look for an external firewall and allow port 22 or disable temporarily

Or you can Pull from the server on the destination server:

rsync -avHPe ssh root@192.168.1.1:/home/temp/SOME_DIR_OR_FILE /home/temp/SOME_DIR_OR_FILE/