#!/bin/bash base_dir="/home/ivo/test" year=`date +"%y"` month=`date +"%m"` day=`date +"%d"` target="${base_dir}/${year}/${month}/${day}" if [ ! -d "${target}" ]; then mkdir -p "${target}"; fi cp -a /tmp/schnack ${target} || logger "xxx backup Mist ..." && logger "vvv Backup done ..."