Friday 14 February 2014

parallel-scp


parallel-scp:

NOTE: you might consider doing: dos2unix <filename> to convert the file from windows/mac developer to unix format, before hosting the file into the unix servers.


[ you need install pssh for parallel-scp ]

$ parallel-scp -h <FileWithServersList> -x "-i key -P port" -l ubuntu path_to_source_file  <remote_path/[file_name]>



example:

$ parallel-scp -r -h List_of_server.txt -x "-i server_private_key -P ssh_port" -l username /home/amitmund/source_file /absolute/path/for/remote/file



example script:


#!/bin/bash

echo" This command will take the following inputs and run the parallel scp command"

read -p "Please enter the host file where you have all the host: " HostsFile
read -p "Please enter the key details: " AwsKey
read -p "Please enter the source_file_path: " source_file
read -p "please enter the remote_path_where_to_scp: " remote_path

/usr/bin/parallel-scp -r -h $HostsFile -x "-i $AwsKey -P PORT" -l ubuntu ${source_file} ${remote_path}


No comments:

Post a Comment