bash, while

카테고리 없음 2021. 6. 24. 14:18

# local pc files backup
echo " local pc files backup ..."
while true
do
        date "+%Y-%m-%d %H:%M:%S"

        d=$(date "+%H")
        echo  d is $d
        if [ "$d" -eq 14  ];then
                echo 'Dbeaver script Copy start =============================================='  ;

                cp /cygdrive/C/Users/hongkildong/AppData/Roaming/DBeaverData/workspace6/General/Scripts/* /cygdrive/d/backup-dbeaver-script

                echo 'Dbeaver script Copy end =============================================='  ;
        fi

        sleep 3600
done