-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupload.sh
More file actions
executable file
·51 lines (44 loc) · 1.29 KB
/
upload.sh
File metadata and controls
executable file
·51 lines (44 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
# this script is meant to be run from your local development machine.
# it uploads the project to the target machine
if [ $1 == "--help" ]; then
echo "usage: ./upload.sh IP_ADDRESS_OR_NAME [TARGET_DIR]"
echo ""
echo " IP_ADDRESS_OR_NAME: the IP address or name of the target machine"
echo " which may include a username for ssh, ex: user@my_jetson.local"
echo " If you are using the same username as locally you can provide"
echo " just the IP address or hostname. ex: my_jetson.local"
echo ""
echo " TARGET_DIR: the directory on the target machine to upload to if not"
echo " the default of /home/$USER/basic_bot"
exit 1
fi
if [ "$1" == "" ]; then
echo "Error: missing parameter IP_ADDRESS_OR_NAME. try: sbin/upload.sh --help"
exit 1
fi
target_host=$1
target_dir="/home/$USER/basic_bot"
if [ "$2" != "" ]; then
target_dir=$2
fi
# echo on
set -x
TARGET_HOST=$1
rsync --progress --partial \
--exclude=node_modules \
--exclude=persisted_state.json \
--exclude=logs/ \
--exclude=pids/ \
--exclude=recorded_video/ \
--exclude=dist/ \
--exclude=basic_bot.egg-info \
--exclude=*.pid \
--exclude=__pycache__ \
--exclude=.pytest_cache \
--exclude=.git \
--exclude=.vscode \
--exclude=.mypy_cache \
--exclude="*_test_output.*" \
--delete \
-avz . $target_host:$target_dir