This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
lsts_glued/utils/mkbackup.bash
2014-02-28 17:07:45 +00:00

34 lines
651 B
Bash
Executable File

#! /bin/bash
backupsystem="glued"
backupfile=$(date -u "+%F.tar.gz")
if [ ! -d "$1" ]; then
echo " "$1" does not exist... "
echo " Usage ./mkbackup.bash \<target folder\>"
exit 1
fi
if [ ! -e "$1/${backupsystem}_backup" ]; then
echo " Creating folder... : $1/${backupsystem}_backup "
mkdir -p "$1/${backupsystem}_backup"
fi
echo " Backup in progress... ($1/${backupsystem}_backup/${backupfile}) "
if [ ! -e "scripts" ]; then
echo " Creating folder scripts... "
mkdir "scripts"
fi
cp *.bash scripts
tar czf "$1/${backupsystem}_backup/${backupfile}" \
architectures \
scripts \
product \
rules \
systems
echo "Done ... "