Skip to content

Instantly share code, notes, and snippets.

@ucalyptus2
Created June 25, 2023 20:36
Show Gist options
  • Save ucalyptus2/c6fc7f2fad13bbb06bd1f26eb4b94998 to your computer and use it in GitHub Desktop.
Save ucalyptus2/c6fc7f2fad13bbb06bd1f26eb4b94998 to your computer and use it in GitHub Desktop.
#!/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