Skip to content

Commit

Permalink
add backup. fix sshfs mount problem
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkcass committed Oct 15, 2018
1 parent 42e1152 commit 787bedc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tools/somax_cmd.exp
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,12 @@ if { "$arg1" == "sshfs" } {
timeout {
send_user "timed out!\n"
}
"fuse: bad mount point*" {
exit 1
}
}
expect "# "
puts "mounted somaxfs"

return 0
}
}
22 changes: 21 additions & 1 deletion tools/somaxdev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
SOMAX_DIR="/home/mcass/somaxdev"

SOMAX_USB_IP="192.168.2.15"
SOMAX_WIFI_IP="192.168.2.15"
SOMAX_WIFI_IP="192.168.1.108"
SOMAX_USER="root"
SOMAX_PASS="somax"

#sshfs remote file system mount to local directory
SSHFS_REMOTE="/root"
SSHFS_LOCAL="$SOMAX_DIR/somaxfs"

SOMAX_BACKUP="$SOMAX_DIR/somax_backup"

EXP_CMD="$SOMAX_DIR/somax/tools/somax_cmd.exp"

wifi=""
Expand Down Expand Up @@ -65,6 +67,24 @@ if [[ $1 == "sshfs" ]]; then
elif [[ "$2" == "clean" ]]; then
fusermount -u $SSHFS_LOCAL
rm -rf $SSHFS_LOCAL/*
elif [[ "$2" == "backup" ]]; then
arch_name="somaxfs-$(date +%Y-%m-%d-%H_%M)-$HOSTNAME.tar"
find $SSHFS_LOCAL -name "*.c" \
-o -name "*.cpp" \
-o -name "*.h" \
-o -name "*.sh" \
-o -name "*.exp" \
-o -name "*.md" \
-o -name "*.service" \
-o -name "Makefile*" \
-o -name "*.calibration" \
| tar --no-recursion -cf $SOMAX_BACKUP/$arch_name -T -

gzip $SOMAX_BACKUP/$arch_name
arch_name+=".gz"
echo " "
echo " Created Archive: $arch_name"
echo " "
fi
else
$EXP_CMD $wifi $1 $2 $3 $4 $5 $6
Expand Down

0 comments on commit 787bedc

Please sign in to comment.