Skip to content

Instantly share code, notes, and snippets.

@nemo-kaz
Created January 28, 2017 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemo-kaz/6544b0f57dada38f4de16ccdb5c530b6 to your computer and use it in GitHub Desktop.
Save nemo-kaz/6544b0f57dada38f4de16ccdb5c530b6 to your computer and use it in GitHub Desktop.
@echo off
rem this batch will call some batch file "updateIt.bat" at each 10 days
rem one line of log.txt is like 2017012 ("2017 Jan 20thday") and so on, if the last line of log.txt
rem is different from now, the next batch file will ba called.
rem So we can invoke updateIt.bat at each 10 days
rem Good for some cleanup acitivity
FOR /F "delims=," %%a IN (log.txt) DO (
IF %%a == %date:~0,4%%date:~5,2%%date:~8,1% (
goto DONE
)
)
echo %date:~0,4%%date:~5,2%%date:~8,1%>> log.txt
echo "10 days have passed" %date:~0,4%%date:~5,2%%date:~8,1%
call updateIt.bat
:DONE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment