Skip to content

Instantly share code, notes, and snippets.

@necrolyte2
Created March 29, 2016 00:32
Show Gist options
  • Save necrolyte2/39d27374191445b14770 to your computer and use it in GitHub Desktop.
Save necrolyte2/39d27374191445b14770 to your computer and use it in GitHub Desktop.
copylatest
@echo off
REM srcdir is the path where MiSeq puts completed runs
set srcdir=D:\Illumina\MiSeqOutput
REM dstdir is the path you want to copy the latest run to
set dstdir=R:\TMPDIR\RUNS\
REM this ensures that the server is mounted as V: drive
mount -o fileaccess=777 -o casesensitive=yes -o sec=sys 141.236.56.110:/vol/VD_Research R:
REM If run path was supplied(drag-n-drop on this script) then use it otherwise
REM try to find latest run automagically
IF /I [%1] == [] (
REM gets the latest run from srcdir
FOR /F "delims=|" %%I IN ('DIR %srcdir%\%latestrun% /A:D /B /O:-D') DO SET latestrun=%%I & GOTO :END
:END
) ELSE (
SET latestrun=%1
)
REM prompts user if they want to sync
set /p doit="Sync %srcdir%\%latestrun%[y/n]? "
REM copys run ignoring errors if user presses y or Y
IF /I "%doit%"=="y" (
xcopy %srcdir%\%latestrun% %dstdir%%latestrun% /c /s /e /h /z /I
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment