Commit 081448d6 authored by Reto Da Forno's avatar Reto Da Forno
Browse files

--delete option added to update script and wrapper adjusted

parent f87f3386
#!/bin/bash
#
# a simple wrapper to activate the conda virtual environment before executing a script
#
# for conda:
#export PATH=/home/flocklab/conda_venv/bin/python:$PATH
#[[ -f /scratch/flocklab/conda/bin/conda ]] && eval "$(/scratch/flocklab/conda/bin/conda shell.bash hook)"
#conda activate py36
#
# alternatively, add the above to .bashrc:
#source ~/.bashrc
# for pyvenv:
source ~/pyvenv/bin/activate
which conda > /dev/null 2>&1
if [ $? -ne 0 ]
then
source ~/.bashrc
else
source ~/pyvenv/bin/activate
fi
$*
......@@ -36,8 +36,8 @@
#
USER="flocklab"
HOST="whymper" # default server
RSYNCPARAMS="-a -z -c -K --exclude=.git --no-perms --no-owner --no-group"
HOST="whymper" # default server
RSYNCPARAMS="-a -z -c -K --exclude=.* --no-perms --no-owner --no-group --ignore-times --delete"
if [ $# -gt 0 ]; then
HOST=$1
......@@ -73,18 +73,16 @@ else
printf "done.\n"
fi
fi
# tools -> only sync on dev server
if [ $HOST = "flocklab-dev-server" ]; then
RES=$(rsync ${RSYNCPARAMS} -i --dry-run -e 'ssh -q' tools/ ${USER}@${HOST}:tools 2>&1)
if [ -z "$RES" ]; then
echo "Tools are up to date."
# tools
RES=$(rsync ${RSYNCPARAMS} -i --dry-run -e 'ssh -q' tools/ ${USER}@${HOST}:tools 2>&1)
if [ -z "$RES" ]; then
echo "Tools are up to date."
else
printf "Updating tools... "
rsync ${RSYNCPARAMS} -e 'ssh -q' tools/ ${USER}@${HOST}:tools
if [ $? -ne 0 ]; then
printf "Failed to copy files!\n"
else
printf "Updating tools... "
rsync ${RSYNCPARAMS} -e 'ssh -q' tools/ ${USER}@${HOST}:tools
if [ $? -ne 0 ]; then
printf "Failed to copy files!\n"
else
printf "done.\n"
fi
printf "done.\n"
fi
fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment