Created
June 25, 2023 20:36
-
-
Save ucalyptus2/c6fc7f2fad13bbb06bd1f26eb4b94998 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function sync_files { | |
input_dir=$1 | |
password=$2 | |
outdir=$3 | |
host=$4 | |
sudo apt install sshpass -y | |
rsync -ratlz --rsh="/usr/bin/sshpass -p $password ssh -o StrictHostKeyChecking=no -l cyan21" --ignore-existing --progress -r $input_dir cyan21@$host.computecanada.ca:$outdir --exclude='/.git' --filter=':- .gitignore' | |
} | |
# Call the function | |
sync_files $1 $2 $3 $4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment