summaryrefslogtreecommitdiffstats
path: root/plugins/org.yocto.remote.utils/resources/ust_tar.sh
blob: 20a803974fb3ba952b2069cb8a38775091bff867 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

#set PATH to include sbin dirs
export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin"

if [ ! -d "$@" ] || [ -z "$@" ]; then
  exit 1
fi

DATESTRING="$(date +%Y%m%d%H%M%S%N)"
BASENAME=`basename $@`
DATAFILE=/tmp/${BASENAME}-${DATESTRING}.tar
cd $@
cd ..

tar -cf  ${DATAFILE} ${BASENAME} &> /dev/null || exit $?

echo -e "ustfile:$DATAFILE\n"