FunkyBuddha Posted June 12, 2024 #1 Posted June 12, 2024 You can use rsync to move your data across two Linux machines. Command: rsync -r --remove-source-files -P -e ssh remoteuser@remotehost:/remote/path /local/path Parameters explained: -r (recurse into directories) --remove-source-files (delete source file once copied -- note: this will not delete directories) -P (keep partially transferred files -- useful when copy is interrupted. it will be able to restart using the partial file) -e (specifies the remote shell to use -- in our example, ssh is specified) This command pulls data from the remote machine. You will need to execute this on the target local machine. 2
FunkyBuddha Posted June 13, 2024 Author #2 Posted June 13, 2024 Here's a bash script you can use to run the process in the background. Requirement(s): Uses sshpass to automate password input for ssh Bash: Quote #!/bin/bash -x rmt_user=remote_user_id rmt_host=ip_address_of_remote_host rmt_dir=/path/to/folder local_dir=/path/to/folder sshpass -p $(cat ~/.password) rsync -r --remove-source-files --progress -p -e ssh $rmt_user@$rmt_host:$rmt_dir $local_dir 1
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now