Skip to content

Instantly share code, notes, and snippets.

@j1ah0ng
Created March 21, 2020 19:18
Show Gist options
  • Save j1ah0ng/31d6c21612e1c304a9856fcb7889f0c7 to your computer and use it in GitHub Desktop.
Save j1ah0ng/31d6c21612e1c304a9856fcb7889f0c7 to your computer and use it in GitHub Desktop.
syncing to ucsd servers
#!/usr/bin/env bash
echo "Please make sure you are running this script from the directory\
containing your working files."
echo -n "The current directory is "
echo -n $(pwd)
echo -n " and contains "
echo -n $(ls -l | wc -L)
echo " files."
echo
echo "If this not correct, ctrl+c now and switch to the correct directory,\
and re-run again."
echo -n "Enter the current hw number (ex. hw9, hw10): "
read hw
echo -n "Enter your cs12wi20xx account without the @ieng6.ucsd.edu suffix: "
read acct
echo "When prompted, please enter the password for your cs12wi20xx account."
rsync -r ./* [email protected]:~/$hw
if [[ $? == 0 ]]; then
echo "Files were successfully saved to [email protected]:~/$hw. "
else echo "Failed. Try again."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment