Skip to content

Instantly share code, notes, and snippets.

View uuklanger's full-sized avatar

uuklanger

View GitHub Profile
@uuklanger
uuklanger / Create Missing Directories
Created December 26, 2016 19:13
As a *Build* step add the following "Execute shell" command.
cd dt_modules/sample
pwd
if [ ! -d "output_data" ]; then
mkdir output_data
fi
@echo off
C:
REM =======================================================================
REM Usage:
REM 1. Copy into a directory where you keep scripts
REM 2. Check the "My Locations" to ensure they align with your environment
REM 3. Confirm JAVA and Tomcat environment
REM 4. Launch and check for dysoweb-tomcat*.txt in your logs directory
REM
REM -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
@echo off
REM
REM Example of howto use a lockfile in BATCH language
REM
:INIT
CD \BatchJobs
ECHO Current Working Directory
CD
@uuklanger
uuklanger / Backup a GIT Repository.sh
Created December 24, 2016 06:00
Assuming you have a repository
#!/bin/bash
# (c)2016 KenWare
#
PROJECTS_FILE=$HOME/projects.list
REPO_DIR=/opt/data/git/repositories
BACKUP_LOCATION=/opt/backups/git_backups
CURRENT_DATE=`date +"%Y%m%d%H%M%S"`
for repo in `cat ${PROJECTS_FILE}` ; do
TARGET_ZIP=${CURRENT_DATE}"_"`echo ${repo}| sed "s/[\/\.]/_/g"`".tar.gz"
echo "REPOSITORY: "${REPO_DIR}/${repo}
@uuklanger
uuklanger / Create filename in DOS with Date and Time
Last active January 9, 2017 19:12
File Batch Date and Time
REM C:\Users\k.langer>echo %FNAME%
REM ARC_20150209_115340.zip
set hr=%time:~0,2%
if "%hr:~0,1%" equ " " set hr=0%hr:~1,1%
set FNAME=ARC_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%.zip
echo %FNAME%