Changes

Jump to navigation Jump to search

Tutorial for model free SBiNLab

1,679 bytes added, 09:46, 15 October 2017
#run
./rsync_to_sbinlab2.sh
</source>
 
=== rsync files from BIO to home mac ===
To inspect from home mac.
 
Make a '''rsync_from_bio_to_home.sh''' file with content
 
<source lang="bash">
#!/bin/bash
read -p "Username on bio:" -r
RUSER=$REPLY
BIO=ssh-bio.science.ku.dk
 
#PROJ=Desktop/kaare_relax
PROJ=Desktop/kaare_relax/20171010_model_free_HADDOCK
PROJDIR=`basename "$PROJ"`
 
FROM=${RUSER}@${BIO}:/home/${RUSER}/${PROJ}
TO=${PWD}/${PROJDIR}
 
# -a: "archive"- archive mode; equals -rlptgoD (no -H,-A,-X). syncs recursively and preserves symbolic links, special and device files, modification times, group, owner, and permissions.
# We want to remove the -o and -g options:
# -o, --owner preserve owner (super-user only)
# -g, --group preserve group
# -rlptD : Instead or
# -a --no-o --no-g
# -z: Compression over network
# -P: It combines the flags --progress and --partial. The first of these gives you a progress bar for the transfers and the second allows you to resume interrupted transfers:
# -h, Output numbers in a more human-readable format.
# Always double-check your arguments before executing an rsync command.
# -n
echo "I will now do a DRY RUN, which does not move files"
read -p "Are you sure? y/n :" -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
rsync -rlptDPzh -n ${FROM} ${TO}
else
echo "Not doing DRY RUN"
fi
echo ""
echo "I will now do the sync of files"
read -p "Are you sure? y/n :" -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
rsync -rlptDPzh ${FROM} ${TO}
else
echo "Not doing anything"
fi
</source>
 
Make it executable and run
<source lang="bash">
chmod +x rsync_from_bio_to_home.sh
 
#run
./rsync_from_bio_to_home.sh
</source>
Trusted, Bureaucrats
1,382

edits

Navigation menu