infinite_loop_windows.bat 726 B

123456789101112131415161718192021
  1. @REM $Id: infinite_loop_windows.bat,v 1.3 2017/11/12 23:59:10 gilles Exp gilles $
  2. @REM An infinite loop with a sleep of 3600 seconds between each run
  3. @REM First let's go in the directory this batch is
  4. CD /D %~dp0
  5. @REM How many seconds to sleep at each run inside the loop is set in the variable %sleep%
  6. @REM If TIMEOUT command is not available then the sleep is done with a ping command.
  7. SET sleep=3600
  8. :loop
  9. @ECHO Hi
  10. .\imapsync.exe --host1 test1.lamiral.info --user1 test1 --password1 "secret1" ^
  11. --host2 test2.lamiral.info --user2 test2 --password2 "secret2" ^
  12. --automap --justfolders --dry
  13. TIMEOUT /T %sleep% || ping 127.0.0.1 -n %sleep%
  14. GOTO loop